Storage medium having game program stored therein and game apparatus

ABSTRACT

A game apparatus includes an input device with which it is possible to specify a position on a screen of a display device. The game apparatus displays a game image representing a virtual game space on the display device. The movement of a first object in the game image is controlled based on an input made on the game image by using the input device. The game apparatus detects a path inputted on the game image by using the input device. The game apparatus moves a second object in the game image along the path.

CROSS REFERENCE TO RELATED APPLICATION

The disclosure of Japanese Patent Application No. 2009-129701, filed May28, 2009, is incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a storage medium having stored thereina game program and a game apparatus, and more particularly to a storagemedium having stored therein a game program and a game apparatus inwhich an object, being a controlled object, is moved along a pathinputted on a screen.

2. Description of the Background Art

There is a conventional technique in which an object (player character),being a controlled object, is moved by using a path that is inputted onthe screen by the player. For example, in a game apparatus described inPatent Document 1 (Japanese Laid-Open Patent Publication No.2007-26129), a relatively large area of a virtual game space (mapscreen) is displayed on a display screen having a touch panel thereon,and the player can input a path on the map screen. The game apparatuscontrols the object so as to move the object along the path inputted onthe map screen. When the object is moving, the game apparatus displaysan area (of the virtual game space) that is smaller than the map screenas the main screen, and how the object is moved is displayed on thismain screen. As described above, by moving the object using a pathinputted on the screen, the player can specify a course of movement ofthe object through an intuitive operation.

In the game apparatus described in Patent Document 1, the playercontrols two objects, i.e., a player character and an item object. Thatis, the player moves a predetermined item object by inputting the pathon the touch panel, while controlling the player character by using thetouch panel. When controlling the player character, the main screen isdisplayed on the display screen so that the player can grasp in detailthe movement of the player character. When controlling the item object,the map screen is displayed on the display screen so as to allow theplayer to input a path, as described above. In the game apparatus, asdescribed above, it is necessary to switch the screen between the mapscreen and the main screen each time the object to be the controlledobject is switched from one to another. Therefore, in order to controlan item object by a path, the player needs to perform a time-consumingoperation of first switching the screen and then drawing a path.

SUMMARY OF THE INVENTION

Therefore, an object of the present invention is to provide a storagemedium having stored therein a game program and a game apparatus inwhich the player can easily perform an operation of moving an object bya path on the screen, in a case where a plurality of objects arecontrolled.

The present invention has the following features to attain the objectmentioned above. Note that the reference numerals, the supplementarydescription and the like in the parentheses indicate a correspondencewith the embodiment described below in order to aid in understanding thepresent invention and are not intended to limit, in any way, the scopeof the present invention.

The present invention is directed to a computer-readable storage mediumhaving stored therein a game program (71) to be executed by a computer(the CPU 31) in a game apparatus (1) including an input device (thetouch panel 13) with which it is possible to specify a position on ascreen of a display device. The program causes the computer to functionas display control means (the CPU 31 performing step S8; hereinafter,only step numbers will be indicated), first object control means (S6),path detection means (S2), and second object control means (S7). Thedisplay control means displays a game image (game space image)representing a virtual game space on the display device (the lower LCD12). The first object control means controls an action of a first object(51) in the game image based on an input made on the game image by usingthe input device. The path detection means detects a path inputted onthe game image by using the input device. The second object controlmeans moves a second object (52) in the game image along the path.

With such a configuration, the input of a path for moving the secondobject therealong is accepted on the game image, on which an input forcontrolling the action of the first object is made. In this way, theplayer can control an object looking at the same game image whether theplayer is controlling the first objector the second object. Therefore,with such a configuration, the player can easily perform an operation ofinputting a path, without having to switch the screen between the mainscreen and the map screen as with conventional techniques. That is, theplayer can easily perform an operation of moving an object by a path onthe screen, in a case where a plurality of objects are controlled.

The game program may cause the computer to further function as pathdisplay means (S78) for displaying the path, superimposed on the gameimage.

With such a configuration, the player can visually check the shape of apath that has been inputted by the player on the screen on which theplayer has inputted the path. The player can visually check, on thescreen, the path along which the second object moves. In this way, theplayer can control the first object while estimating the course ofmovement of the second object, and it is therefore possible to easilycontrol two objects.

The game program may cause the computer to further function asdesignated area setting means (S37) for setting a designated area basedon a position of the second object in the virtual game space. In thiscase, if a position of an input made on the game image is within thedesignated area (YES in S16), the second object control means moves thesecond object along a path that is represented by an input that iscontinuing from the input within the designated area (S7). If a positionof an input made on the game image is outside the designated area (NO inS16), the first object control means controls an action of the firstobject based on the input. Note that the phrase “a path that isrepresented by an input that is continuing from the input within thedesignated area” refers to a path made up of (points of) input positionsof an input that is continuously made, starting from a position withinthe designated area. Specifically, if the starting position of acontinuous input is within designated area, this phrase refers to a paththat is represented by the entire input. If a position midway through acontinuous input is within the designated area, this phrase refers to apath that is formed by the midway position and input positionssubsequent thereto.

With such a configuration, whether to control the second object or thefirst object based on an input is determined depending on whether theinput position is inside or outside the designated area. Where twoobjects are controlled with only one input device, in order to determinethe object to be controlled by an input made on the input device, it istypically necessary to perform, before making the input, an operation ofspecifying the controlled object (or switching the controlled objectfrom one to another). In contrast, with such a configuration asdescribed above, since the controlled object is determined depending onthe input position, the player does not need to perform an operationonly for switching controlled objects from one to another, thus makingit easier to control two objects.

The display control means may display an image representing thedesignated area (the path mark 53), superimposed on an image of thesecond object in the game image.

With such a configuration, the player can clearly perceive the boundaryof the designated area. In this way, since the player will not mistakethe boundary, the player can reliably control the object, which theplayer intends to control, and the player will not inadvertently controlan unintended object. As described above, with such a configuration, itis possible to provide a game with a good controllability.

The designated area setting means may move the designated area, togetherwith the second object, along the path (S37). In this case, if a newinput starting from a position within the designated area is made byusing the input device while the second object is moving along a path,the second object control means moves the second object along a pathrepresented by an input that is continuing from the new input within thedesignated area.

With such a configuration, if the player newly inputs a different pathwhile the second object is moving along a path, the second object movesalong the new path. Therefore, the player can change the path while thesecond object is moving along the path. Therefore, if the playerinadvertently inputs an unintended path, or if the player wishes tochange the destination of the second object while the first object isperforming an action, the player can readily correct the path. Asdescribed above, with such a configuration, it is possible to provide agame with a good controllability.

The first object control means may move the first object based on aninput made on the game image by using the input device.

With such a configuration, the player can easily move the first objectby only specifying the input position. It is possible to control twoobjects, i.e., the first object and the second object, with a singleinput device. Therefore, the player can easily perform an operation ofmoving the two objects without having to change the input device (inputmethod) when switching the controlled object between the two objects.

The first object control means may control the first object to performan action each time an input made on the game image by using the inputdevice is detected. In this case, the second object control means movesthe second object each time the input of the path is completed.

With such a configuration, the first object performs an actionimmediately in response to an input made on the input device, whereasthe second object performs an action (or moves) when an input of a pathon the input device is completed. That is, with such a configuration,when the player makes an input, the first object performs an actionimmediately in response to the input, whereas the second object performsan action after the input is completed. As described above, the timingat which the second object responds to a player's input is made laterthan the timing for the first object, and it is therefore possible tocontrol the first object to perform an action even while the secondobject is moving. Therefore, with such a configuration, although thegame apparatus controls the actions of the two objects by switching thecontrolled object from one to another depending on the input made on theinput device, the two objects can be controlled to perform actions atthe same time. Thus, the game apparatus can make the player feel as ifthe player were controlling two objects at the same time.

If a predetermined instruction is given by a player (YES in step S12),the second object control means may control the movement of the secondobject based on a position of the first object (S36).

With such a configuration, the player can not only move the secondobject along the path, but also move the second object in accordancewith the movement of the first object. For example, it is possible tomove the second object so as to follow the first object, or to move thesecond object in a synchronized manner with the first object. With sucha configuration, it is possible to increase the variety of ways ofmoving the second object, which makes it even easier for the player tocontrol the second object.

If the predetermined instruction is given by the player, the secondobject control means moves the second object to the position of thefirst object, and then moves the second object so as to follow the firstobject whose action is controlled by the first object control means.

With such a configuration, in response to the predetermined instruction,the second object will move following the first object. Therefore, withsuch a configuration, the player can not only control two objectsseparately, but can also control the two objects together in a singleoperation.

The game program causes the computer to further function as designatedarea setting means (S37) for setting a designated area (the path mark53) based on a position of the second object in the game image. In thiscase, the display control means displays a predetermined image on thegame image (S73 and S75) so that the predetermined image is erased atleast while an input starting from a position within the designated areais being made on the game image (YES in S71). The second object controlmeans controls the movement of the second object by using an input madeby the input device at a position of the predetermined image as thepredetermined instruction.

With such a configuration, the predetermined image used for controllingthe second object to move based on the position of the first object isnot displayed while a path for moving the second object therealong isbeing inputted. That is, the predetermined image is not displayed whenit is not needed, and it is therefore possible to prevent the playerfrom erroneously making an input on the predetermined image and toprovide a game image that is easier for the player to view.

The display control means may switch, based on an instruction from aplayer (an instruction made by touching the switch icon 54), between astate where a display area of a virtual game space is set so that thefirst object is included in the game image (S74 and S75) and anotherstate where the display area is set so that the second object isincluded in the game image (S72 and S73).

In a case where the player is allowed to control two objects, one of thetwo objects may possibly move out of the display area of the displaydevice so that both of the objects cannot be displayed at the same time,depending on the circumstances in the game. In contrast, with such aconfiguration as described above, even in such a case, the player caneasily keep displayed one of the two objects that the player wishes tobe displayed (one that the player wishes to control).

The display control means may selectively display one of, orsimultaneously display both of, the game image (game space image) and awide-area image (map image) representing a larger area than an area of agame space represented by the game image, on the display device (S79).

With such a configuration, an image representing a larger game spacethan the area of the game space represented by the game image isdisplayed, in addition to the game image in which objects arecontrolled. In this way, the player can more easily grasp the positionalrelationship of the inputted path (in the game space), and can moreeasily input a path.

The display control means may display a path used for moving the secondobject, superimposed on the wide-area image (FIG. 10, S78).

With such a configuration, the player can visually check an inputtedpath also on the wide-area image representing a larger area than thegame image on which the input has been made, and can more easily input apath.

The present invention may be embodied as a game apparatus having similarfunctions to those of the game apparatus set forth above. Note that insuch a game apparatus, the various means may be implemented by a CPUexecuting a game program, or some or all of the various means may beimplemented by a dedicated circuit or circuits of the game apparatus.

According to the present invention, an input of a path for moving asecond object therealong is accepted on a game image, on which an inputfor controlling an action of a first object is made. Thus, the player nolonger needs to perform a screen-switching operation between two images,thereby allowing the player to easily perform an operation of inputtinga path.

These and other objects, features, aspects and advantages of the presentinvention will become more apparent from the following detaileddescription of the present invention when taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an external view of a game apparatus for executing a gameprogram according to an embodiment of the present invention;

FIG. 2 is a block diagram illustrating an exemplary internalconfiguration of the game apparatus;

FIG. 3 is a diagram illustrating a game image displayed on a displaydevice by a game process according to the present embodiment;

FIG. 4 is a diagram illustrating a game image showing how a first object51 acts in response to the player's operation;

FIG. 5 is a diagram illustrating a game image where a path 56 forcontrolling a second object 52 is being inputted by the player;

FIG. 6 is a diagram illustrating a game image showing how the secondobject 52 moves along the inputted path 56;

FIG. 7 is a diagram illustrating a game image where the first object 51is controlled while the second object 52 is moving;

FIG. 8 is a diagram illustrating a game image where an operation ofchanging a path is performed midway through the movement of the secondobject 52;

FIG. 9 is a diagram illustrating a game image where an operation ofchanging a path is performed midway through the movement of the secondobject 52;

FIG. 10 is a diagram illustrating a game image displayed on an upper LCD22 of a game apparatus 1;

FIG. 11 is a diagram illustrating a game image while the second object52 is moving along the path 56;

FIG. 12 is a diagram illustrating a game image at a point in time whenthe second object 52 finishes a mid-path action;

FIG. 13 is a diagram illustrating another example of a game image at apoint in time when the second object 52 finishes a mid-path action;

FIG. 14 is a diagram illustrating another example of a game image at apoint in time when the second object 52 finishes a mid-path action;

FIG. 15 is a diagram illustrating a game image where priority points areset;

FIG. 16 is a diagram illustrating data stored in a main memory 32 of thegame apparatus 1;

FIG. 17 is a main flow chart illustrating the flow of a game processexecuted by the game apparatus 1;

FIG. 18 is a flow chart illustrating the flow of an input determinationprocess (step S3) shown in FIG. 17;

FIG. 19 is a flow chart illustrating the flow of a path setting process(step S4) shown in FIG. 17;

FIG. 20 is a flow chart illustrating the flow of a second object controlprocess (step S7) shown in FIG. 17;

FIG. 21 is a flow chart illustrating the flow of a move-along-pathprocess (step S32) shown in FIG. 20;

FIG. 22 is a flow chart illustrating the flow of a return pointdetermination process (step S52) shown in FIG. 21; and

FIG. 23 is a flow chart illustrating the flow of a display controlprocess (step S8) shown in FIG. 17.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[Hardware Configuration of the Game Apparatus]

A game program and game apparatus according to an embodiment of thepresent invention will be described with reference to the drawings.While the present invention can be achieved by the present program beingexecuted in any computer system capable of displaying a game image on adisplay device, the present embodiment will be described with respect tothe case where a game apparatus 1 shown in FIG. 1 is used as an exampleof the game apparatus.

FIG. 1 is an external view of the game apparatus 1 for executing a gameprogram according to the present embodiment. Here, a hand-held gameapparatus is shown as an example of the game apparatus 1. Note that thegame apparatus 1 includes a camera and functions as an imaging devicefor taking an image with the camera, displaying the taken image on thescreen, and storing data for the taken image.

In FIG. 1, the game apparatus 1 is a foldable hand-held game apparatus,and the game apparatus 1 shown in the figure is unfolded (open state).The game apparatus 1 is structured in a size allowing the user to holdit with both hands, or even one hand, when unfolded.

The game apparatus 1 has a lower housing 11 and an upper housing 21. Thelower housing 11 and the upper housing 21 are connected so as to beopenable/closable (foldable). In the example of FIG. 1, the lowerhousing 11 and the upper housing 21 are each formed in the shape of ahorizontally elongated rectangular plate, and connected so as to bepivotable at their common long side joint. Typically, the user uses thegame apparatus 1 in open state. Also, when the user does not use thegame apparatus 1, the game apparatus 1 is stored in closed state. Inaddition, in the example shown in FIG. 1, the game apparatus 1 canmaintain not only the closed and open states but also its opening statevia friction force generated at the joint at any angle that can be madeby the lower housing 11 and the upper housing 21 between the closed andopen states. That is, the upper housing 21 can remain stationary at anarbitrary angle with respect to the lower housing 11.

The lower housing 11 is provided with a lower LCD (Liquid CrystalDisplay) 12. The lower LCD 12 is horizontally long, and is arranged suchthat its longitudinal direction coincides with the longitudinaldirection of the lower housing 11. Note that in the present embodiment,LCDs are used as display devices to be included in the game apparatus 1,but any other display devices, such as EL (Electro Luminescence) displaydevices, may be used. In addition, display devices of any resolution canbe used for the game apparatus 1. Note that an image being taken by aninternal camera 23 or an external camera 25 is displayed in real-time onlower LCD 12.

The lower housing 11 is provided with various operation buttons 14A to14K and a touch panel 13 as input devices. As shown in FIG. 1, of allthe operation buttons 14A to 14K, the direction input button 14A, theoperation button 14B, the operation button 14C, the operation button14D, the operation button 14E, the power button 14F, the start button14G, and the select button 14H are provided at the inner principalsurface of the lower housing 11, which is placed on the interior sidewhen the upper housing 21 and the lower housing 11 are folded. In theexample shown in FIG. 1, the direction input button 14A and the powerbutton 14F are provided to the left or right (in FIG. 1, to the left) ofthe lower LCD 12 provided at the center of the inner principal surfaceof the lower housing 11. In addition, the operation buttons 14B to 14E,the start button 14G, and the select button 14H are provided to theopposite side (in FIG. 1, to the right) of the lower LCD 12 on the innerprincipal surface of the lower housing 11. The direction input button14A, the operation buttons 14B to 14E, the start button 14G, and theselect button 14H are used for various operations on the game apparatus1. For example, the direction input button 14A is used for selectionoperations and so on. The operation buttons 14B to 14E are used forsetting and cancellation operations and so on. The power button 14F isused for turning ON/OFF the game apparatus 1.

Note that in FIG. 1, the operation buttons 141 to 14K are not shown. Forexample, the L button 14I is provided at the left edge of the uppersurface of the lower housing 11, and the R button 14J is provided at theright edge of the upper surface of the lower housing 11. For example,the L button 14I and the R button 14J are used for imaging instructionoperations (shutter operations) on the game apparatus 1 having animaging function. Furthermore, the volume button 14K is provided at theleft side surface of the lower housing 11. The volume button 14K is usedfor controlling the volume of a speaker included in the game apparatus1.

Also, in addition to the operation buttons 14A to 14K, the gameapparatus 1 further includes another input device, a touch panel 13allowing designation of an arbitrary position on the screen. The touchpanel 13 is attached so as to cover the screen of the lower LCD 12. Notethat in the present embodiment, a touch panel 13 is, for example, of aresistive film type. However, the touch panel 13 is not limited to theresistive film type, and may be of any type. Also, in the presentembodiment, for example, the touch panel 13 has the same resolution(detection accuracy) as the lower LCD 12. However, the touch panel 13 isnot necessarily required to be equal in resolution to the lower LCD 12.In addition, the lower housing 11 has an insertion opening (in FIG. 1,indicated by broken lines) provided in its right side surface. Theinsertion opening can store a touch pen 27 to be used for operating thetouch panel 13. Note that any input to the touch panel 13 (touch input)is normally performed with the touch pen 27, but the touch pen 27 is notrestrictive, and the touch panel 13 can be operated with the user'sfinger.

Also, the lower housing 11 has provided in the right side surface aninsertion opening (in FIG. 1, indicated by two-dot chain lines) forstoring a memory card 28. The insertion opening has provided therein aconnector (not shown) for electrically connecting the game apparatus 1and the memory card 28. The memory card 28 is, for example, an SD(Secure Digital) memory card removably attached to the connector. Forexample, the memory card 28 is used for storing (saving) images taken bythe game apparatus 1 and reading into the game apparatus 1 imagesgenerated by other apparatuses.

Furthermore, the lower housing 11 has provided in its upper side surfacean insertion opening (in FIG. 1, indicated by one-dot chain lines) forstoring a memory card 29. This insertion opening also has providedtherein a connector (not shown) for electrically connecting the gameapparatus 1 and the memory card 29. The memory card 29 is a storagemedium having a game program or suchlike stored therein, and isremovably loaded into the insertion opening provided in the lowerhousing 11.

Three LEDs 15A to 15C are provided to the left of the joint between thelower housing 11 and the upper housing 21. Here, the game apparatus 1 iscapable of wirelessly communicating with other equipment, and the firstLED 15A is lit up while the game apparatus 1 is ON. The second LED 15Bis lit up while the game apparatus 1 is being charged. The third LED 15Cis lit up when wireless communication is established. Accordingly, thethree LEDs 15A to 15C allow the user to know the statuses of the gameapparatus 1, regarding ON/OFF of the power supply, battery charge, andcommunications.

On the other hand, the upper housing 21 is provided with an upper LCD22. The upper LCD 22 is horizontally long, and is arranged such that itslongitudinal direction coincides with the longitudinal direction of theupper housing 12. Note that as in the case of the lower LCD 12, anydisplay device of any other type and resolution may be used instead ofthe upper LCD 22. Note that a touch panel may be provided over the upperLCD 22. The upper LCD 22 displays, for example, an operation instructionscreen for teaching the user about the roles of the operation buttons14A to 14K and the touch panel 13.

Also, the upper housing 21 is provided with two cameras (an internalcamera 23 and an external camera 25). As shown in FIG. 1, the internalcamera 23 is provided at the inner principal surface close to the jointof the upper housing 21. On the other hand, the external camera 25 isprovided opposite to the side of the inner principal surface where theinternal camera 23 is provided, i.e., the external principal surface ofthe upper housing 21 (the exterior surface of the game apparatus 1 inclosed state; the back of the upper housing 21 shown in FIG. 1). Notethat in FIG. 1, the external camera 25 is indicated by a broken circle.As a result, the internal camera 23 can take images of the direction inwhich the inner principal surface of the upper housing 21 is oriented,while the external camera 25 can take images of the direction oppositeto the imaging direction of the internal camera 23, i.e., the directionin which the external principal surface of the upper housing 21 isoriented. In this manner, in the present embodiment, the two cameras,i.e., the internal and external cameras 23 and 25, are provided so as totake images in their respective directions opposite to each other. Forexample, the user can use the internal camera 23 to take images of aview from the game apparatus 1 toward the user, and also can use theexternal camera 25 to take images of a view in the opposite direction,i.e., from the user toward the game apparatus 1.

Note that a microphone (microphone 43 shown in FIG. 2) is provided as anaudio input device under the inner principal surface close to the joint.In addition, a microphone hole 16 is provided in the inner principalsurface close to the joint such that the microphone 43 can sense soundfrom outside the game apparatus 1. The microphone 43 and the microphonehole 16 are not necessarily required to be positioned at the joint. Forexample, the microphone 43 may be accommodated within the lower housing11, and the microphone hole 16 may be provided in the lower housing 11at a position corresponding to the position where the microphone 43 isaccommodated.

Also, a fourth LED 26 (in FIG. 1, indicated by a broken circle) isprovided at the external principal surface of the upper housing 21. Thefourth LED 26 is lit up at the time the internal camera 23 or theexternal camera 25 takes an image (when the shutter button is pressed).Furthermore, the light is on while the internal camera 23 or theexternal camera 25 is taking a motion picture. As such, the fourth LED26 allows any subject and bystander to know the game apparatus 1 took(or is taking) a picture.

Also, a sound hole 24 is provided to both the left and the right of theupper LCD 22 provided at the center of the inner principal surface ofthe upper housing 21. A speaker is accommodated within the upper housing21 below each sound hole 24. The sound hole 24 is a hole for emanatingthe sound from the speaker to the outside of the game apparatus 1.

As described above, the upper housing 21 is provided with the internaland external cameras 23 and 25 configured to take images, as well as theupper LCD 22 acting as a display means for mainly displaying theoperation instruction screen. On the other hand, the lower housing 11 isprovided with the input devices (the touch panel 13 and the operationbuttons 14A to 14K) for operational inputs to the game apparatus 1, andthe lower LCD 12 acting as a display means for displaying taken images.Accordingly, when using the game apparatus 1, the user can see a takenimage (an image taken by the camera) displayed on the lower LCD 12 andmake inputs via the input devices while holding the lower housing 11.

Next, an internal configuration of the game apparatus 1 will bedescribed with reference to FIG. 2. FIG. 2 is a block diagramillustrating an exemplary internal configuration of the game apparatus1.

In FIG. 2, the game apparatus 1 includes electronic parts, such as a CPU31, a main memory 32, a memory control circuit 33, a saved data memory34, a preset data memory 35, a memory card interface (memory card I/F)36, a memory card I/F 37, a wireless communication module 38, a localcommunication module 39, a real time clock (RTC) 40, a power circuit 41,an interface circuit (I/F circuit) 42, a first GPU (Graphics ProcessingUnit) 45, a second GPU 46, a first VRAM (Video RAM) 47, a second VRAM48, and an LCD controller 49. These electronic parts are mounted on anelectronic circuit board, and accommodated within the lower housing 11(or may be accommodated within the upper housing 21).

The CPU 31 is an information processing means for executing apredetermined program (here, a game program according to the presentembodiment). In the present embodiment, the game program is stored in amemory (e.g., saved data memory 34) within the game apparatus 1 as wellas in the memory card 28 and/or 29, and the CPU 31 executes the gameprogram, thereby executing a game process to be described later. Notethat the program to be executed by the CPU 31 may be prestored in thememory within the game apparatus 1 or may be acquired from the memorycard 28 and/or 29 or from other equipment through communicationtherewith.

The CPU 31 is connected to the main memory 32, the memory controlcircuit 33, and the preset data memory 35. The memory control circuit 33is connected to the saved data memory 34. The main memory 32 is astorage means used as a working area or buffering area for the CPU 31.Specifically, a main memory 32 stores various data to be used in thegame process, and programs acquired from outside (e.g., the memory cards28 and 29 and other equipment). In the present embodiment, for example,a PSRAM (Pseudo-SRAM) is used as the main memory 32. The saved datamemory 34 is a storage means for storing, for example, the programs tobe executed by the CPU 31 and data for images taken by the internalcamera 23 and the external camera 25. The saved data memory 34 isconfigured by a nonvolatile storage medium, e.g., in the presentembodiment, a NAND flash memory. The memory control circuit 33 is acircuit for controlling data reading from/writing to the saved datamemory 34 in accordance with an instruction by the CPU 31. The presetdata memory 35 is a storage means for storing data (preset data) such asvarious present parameters for the game apparatus 1. As for the presetdata memory 35, a flash memory connected to the CPU 31 via an SPI(Serial Peripheral Interface) bus can be used.

The memory card I/Fs 36 and 37 are each connected to the CPU 31. Thememory card I/F 36 reads/writes data from/to the memory card 28 attachedto the connector in accordance with an instruction from the CPU 31.Also, the memory card I/F 37 reads/writes data from/to the memory card29 attached to the connector in accordance with an instruction from theCPU 31. In the present embodiment, image data taken by the internalcamera 23 and the external camera 25, as well as image data receivedfrom other devices are written into the memory card 28, and image datastored in the memory card 28 is read from the memory card 28 and storedto the saved data memory 34 or transmitted to other devices. Inaddition, various programs stored in the memory card 29 are read andexecuted by the CPU 31.

Note that the game program of the present invention may be supplied to acomputer system not only via an external storage medium, such as thememory card 29, but also via a wired or wireless communication line.Also, the game program may be pre-recorded to a nonvolatile storagedevice within the computer system. Note that the information storagemedium for storing the game program is not limited to the nonvolatilestorage device, and may be a CD-ROM, a DVD, or a similar optical diskstorage medium.

The wireless communication module 38 has a function of connecting to awireless LAN in accordance with a system complying with, for example,the IEEE802.11.b/g standard. Also, the local communication module 39 hasa function of wirelessly communicating with similar game apparatuses inaccordance with a predetermined communication system. The wirelesscommunication module 38 and the local communication module 39 areconnected to the CPU 31. The CPU 31 is capable of transmitting/receivingdata to/from other equipment via the Internet using the wirelesscommunication module 38, as well as transmitting/receiving data to/fromother similar game apparatuses via the Internet using the localcommunication module 39.

The CPU 31 is also connected to the RTC 40 and the power circuit 41. TheRTC 40 counts time and provides an output to the CPU 31. For example,the CPU 31 can calculate the current time (date) based on the timecounted by the RTC 40. The power circuit 41 controls power supplied fromthe power supply (typically, a battery accommodated in the lower housing11) provided in the game apparatus 1, and supplies power to variousparts of the game apparatus 1.

The game apparatus 1 is also provided with the microphone 43 and anamplifier 44. The microphone 43 and the amplifier 44 are each connectedto the I/F circuit 42. The microphone 43 senses the voice of the userspeaking to the game apparatus 1, and outputs an audio signalrepresenting the voice to the I/F circuit 42. The amplifier 44 amplifiesthe audio signal from the I/F circuit 42 to provide an output from thespeaker (not shown). The I/F circuit 42 is connected to the CPU 31.

Also, the touch panel 13 is connected to the I/F circuit 42. The I/Fcircuit 42 includes an audio control circuit for controlling themicrophone 43 and the amplifier 44 (speaker), and a touch panel controlcircuit for controlling the touch panel 13. The audio control circuitperforms A/D conversion and D/A conversion on the audio signal, and alsoconverts the audio signal into audio data of a predetermined format. Thetouch panel control circuit generates touch position data of apredetermined format based on a signal from the touch panel 13, andoutputs the generated data to the CPU 31. For example, the touchposition data is data representing coordinates of a position (touchposition) at which an input was made to the input screen of the touchpanel 13. Note that the touch panel control circuit performs reading ofa signal from the touch panel 13 and generation of touch position dataonce every predetermined period of time. The CPU 31 can obtain theposition at which an input was made to the touch panel 13 by acquiringthe touch position data via the I/F circuit 42.

The above-described operation buttons 14A to 14K constitute an operationbutton section 14 connected to the CPU 31. The operation button section14 outputs to the CPU 31 operation data representing the status of inputto the operation buttons 14A to 14K (whether or not the buttons havebeen pressed). The CPU 31 acquires the operation data from the operationbutton section 14, and executes a process in accordance with an input tothe operation button section 14.

The internal camera 23 and the external camera 25 are each connected tothe CPU 31. The internal camera 23 and the external camera 25 each takean image in accordance with an instruction from the CPU 31, and outputdata for the taken image to the CPU 31. In the present embodiment, theCPU 31 instructs either the internal camera 23 or the external camera 25to perform imaging, and the camera instructed to perform imaging takesan image and transmits image data to the CPU 31.

The first GPU 45 is connected to the first VRAM 47, and the second GPU46 is connected to the second VRAM 48. In accordance with an instructionfrom the CPU 31, the first GPU 45 generates a first display image basedon display image generation data stored in the main memory 32, andcreates an image on the first VRAM 47. In accordance with an instructionfrom the CPU 31, the second GPU 46 generates a second display image, andcreates an image on the second VRAM 48, as in the case of the first GPU45. The first VRAM 47 and the second VRAM 48 are connected to the LCDcontroller 49.

The LCD controller 49 includes a register 491. The register 491 storesthe value of 0 or 1 in accordance with an instruction from the CPU 31.When the value in the register 491 is 0, the LCD controller 49 outputsthe first display image created on the first VRAM 47 to the lower LCD12, and also outputs the second display image created on the second VRAM48 to the upper LCD 22. Alternatively, when the value in the register491 is 1, the LCD controller 49 outputs the first display image createdon the first VRAM 47 to the upper LCD 22, and also outputs the seconddisplay image created on the second VRAM 48 to the lower LCD 12. Forexample, the CPU 31 is capable of causing the lower LCD 12 to display animage acquired from either the internal camera 23 or the external camera25, while causing the upper LCD 22 to display an operation instructionscreen generated by a predetermined process.

[Outline of the Game Process]

Next, the game process to be executed by the game program according tothe present embodiment will be outlined with reference to FIGS. 3 to 15.This game process implements a game in which two objects appearing in avirtual game space are controlled by the touch panel 13.

FIG. 3 is a diagram illustrating a game image displayed on a displaydevice (the lower LCD 12) by the game process of the present embodiment.As shown in FIG. 3, the lower LCD 12 displays a game space imagerepresenting a partial area of the virtual game space. Specifically, agame space image is displayed, which includes a first object 51, asecond object 52, and a path mark 53. In the present embodiment, thegame apparatus 1 can display a game space image representing a partialarea of the virtual game space, and a map image representing a greaterarea than the area represented by the game space image. The game imageshown in FIG. 3 corresponds to the game space image, and the game imageshown in FIG. 10 to be referred to later corresponds to the map image.In the present embodiment, a switch icon 54 is displayed, superimposedon the game space image. The function of the switch icon 54 will bedescribed later. Note that depending on the circumstances, the lower LCD12 may display, in addition to the game space image described above, apath inputted by using the touch panel 13, a follow icon (to bedescribed later), etc.

As shown in FIG. 3, two objects, i.e., the first object 51 and thesecond object 52, appear in the virtual game space. The first and secondobjects 51 and 52 are each an object to be controlled by the player. Inthe present embodiment, the player operates the objects 51 and 52 usingthe touch panel 13. The action of the first object 51 is controlledbased on a position (touch position) on the input screen of the touchpanel 13 that is touched by the player or a path inputted by the playeron the input screen. The action of the second object 52 is controlled sothat the second object 52 moves along the path.

FIG. 4 is a diagram illustrating a game image showing how the firstobject 51 acts in response to the player's operation. In the presentembodiment, an operation on the first object 51 is performed by usingthe touch panel 13. An operation on the first object 51 is performed onthe game space image (not on the map image). As shown in FIG. 4, thepath mark 53 is displayed at the position of the second object 52 in thegame space image. In order to control the first object 51, the playermakes an input starting from a position within the game space that isoutside the path mark 53. For example, as shown in FIG. 4, if the playermakes an input by touching a position within the game space, the gameapparatus 1 moves the first object 51 toward a position (within the gamespace) corresponding to the touch position. Note that the operation ofthe first object 51 using the touch panel 13 is not limited to theoperation shown in FIG. 4, but may be any suitable operation. Forexample, the game apparatus 1 may control the first object 51 to performan action such as attacking or jumping, depending on the path inputtedon the touch panel 13. Note that while the first object 51 is beingcontrolled, the game apparatus 1 displays a follow icon 55, superimposedon the game space image, on the lower LCD 12, as shown in FIG. 5. Thefunction of the follow icon 55 will be described later.

FIG. 5 is a diagram illustrating a game image where the path 56 forcontrolling the second object 52 is being inputted by the player. Alsowhen controlling the second object 52, as when controlling the firstobject 51, the player makes an input on the game space image by usingthe touch panel 13. When controlling the second object 52, however, theplayer inputs the path 56 starting from a position of the path mark 53,as shown in FIG. 5. The inputted path 56 is displayed, superimposed onthe game space image, on the lower LCD 12. In the present embodiment,the game apparatus 1 displays the path 56 with an arrowhead attached atits end, as shown in FIG. 5, while the path 56 is being inputted.

FIG. 6 is a diagram illustrating a game image showing how the secondobject 52 moves along the inputted path 56. As shown in FIG. 6, when theinput of the path 56 is finished, the game apparatus 1 moves the secondobject 52 along the path 56. As described above, in the presentembodiment, the path 56 is inputted on the game space image (not on themap image), and how the second object 52 moves along the inputted path56 is shown on the game space image. Note that in the presentembodiment, the game apparatus 1 displays a path 56 that has beeninputted with a circle attached at its end, instead of an arrowhead, sothat the player can easily distinguish between a path being inputted anda path that has been inputted.

Note that in the present embodiment, the player is allowed to controlthe first object 51 even while the second object 52 is moving along thepath 56. FIG. 7 is a diagram illustrating a game image where the firstobject 51 is controlled while the second object 52 is moving. As shownin FIG. 7, if the player makes an input by touching a position withinthe game space that is outside the path mark 53 while the second object52 is moving along the path 56, the game apparatus 1 moves the firstobject 51 toward a position corresponding to the touch position. Asdescribed above, in the present embodiment, the second object 52continues to move even while controlling the first object 51. That is,while the second object 52 is moving, the player can move both of thefirst object 51 and the second object 52. In the present embodiment,since the path 56 is displayed even while the second object 52 is moving(FIG. 7), the player can control the first object 51 while estimatingthe course of movement of the second object 52.

As described above, in the present embodiment, the game apparatus 1accepts inputs for controlling the objects 51 and 52 on the game spaceimage representing a partial area of the virtual game space, not on themap image. That is, the game apparatus 1 controls the action of thefirst object 51 within the game space image based on the player'soperation (FIG. 4, FIG. 7). The game apparatus 1 detects a path inputtedon the game space image using the touch panel 13, and moves the secondobject 52 in the game space image along the path (FIG. 5, FIG. 6). Inthis way, the player can control two objects on the same image, with noneed for a screen-switching operation. Therefore, the player can easilyperform the operation of moving the second object 52 using a path, andit is possible to provide a game with a good controllability.

In the present embodiment, the game apparatus 1 controls the action ofthe first object 51 based on the input made on the game space imageusing the touch panel 13. That is, the player can control both of thefirst object 51 and the second object 52 using the touch panel 13. Forexample, where the first object 51 is controlled by operation buttons,the player needs to take the trouble of repositioning the touch pen inhand when switching the controlled object between the first object 51and the second object 52. In contrast, in the present embodiment, twoobjects can be controlled with a single input device, and it istherefore possible to easily control two objects.

Where both of the first object 51 and the second object 52 arecontrolled using the touch panel 13, it is necessary to determine theobject meant to be controlled by the touch input being made. In view ofthis, the game apparatus 1 moves the second object 52 along a pathrepresented by an input made on the game space image if the startingposition of the input is located within a predetermined designated area(the area within the path mark 53) (FIG. 5, FIG. 6), whereas the gameapparatus 1 controls the action of the first object 51 based on theinput if the starting position of the input is located outside thedesignated area (FIG. 4). That is, the game apparatus 1 determineswhether to control the second object 52 or the first object 51 based onan input made on the touch panel 13 depending on whether the startingposition of the input is inside or outside the designated area.Therefore, according to the present embodiment, the player does not needto perform an operation only for switching controlled objects from oneto another, thus making it easier to control two objects. If both of thetwo objects act in response to a single touch input, the player needs tooperate while simultaneously taking two objects into consideration, thusmaking the operation more difficult. In contrast, according to thepresent embodiment, both of the two objects will not react to a singletouch input (except for the case to be described later where the secondobject 52 follows the first object 51), and the player can thereforeeasily control two objects.

Moreover, in the present embodiment, the game apparatus 1 displays thepath mark 53, as an image representing the designated area, superimposedon the second object 52. If the designated area were not displayed, theplayer would not know the boundary indicating which object is to becontrolled, and the player might perform an erroneous operation. Forexample, there may occur a case where the player makes a touch input ata position near the second object 52 (intending to control the secondobject 52) but the touch position is actually outside the designatedarea, and the game apparatus 1 consequently makes the first object 51 toact. In contrast, in the present embodiment, the boundary can bedisplayed clearly by superimposing the path mark 53 on the second object52. Therefore, even if two objects are controlled on the same image, itis possible to prevent an erroneous operation of controlling an objectthat is not intended by the player.

In the present embodiment, the player can change a path while the secondobject 52 is moving along the path. FIGS. 8 and 9 are diagrams eachillustrating a game image where an operation of changing a path isperformed midway through the movement of the second object 52. As shownalso in FIGS. 6 and 7, when the second object 52 moves along the path56, the game apparatus 1 moves the path mark 53, together with thesecond object 52, along the path 56. When changing the path at thispoint, the player makes a new input starting from the position of thepath mark 53, as shown in FIG. 8. As the new input is made, the gameapparatus 1 erases the path 56, which has been displayed before theinput is made (in FIG. 8, the path 56 to be erased is indicated by adotted line). Moreover, the second object 52 stops. Then, the playerinputs a new path 57 starting from the position of the path mark 53, asshown in FIG. 9. When the input of the path 57 is finished, the gameapparatus 1 moves the second object 52 along the new path 57. Asdescribed above, if anew input is made starting from a position withinthe path mark 53 while the second object 52 is moving along the path 56,the game apparatus 1 moves the second object 52 along the path 57represented by the new input. Thus, the player can easily change thepath for moving the second object 52 therealong. In the presentembodiment, since the path mark 53 is displayed, which moves togetherwith the second object 52, the player can make an input aiming at thepath mark 53, and it is possible to prevent such an erroneous operationas described above even when changing the path.

In the present embodiment, the player can not only move the secondobject 52 along a path, but also move the second object 52 so as tofollow the first object 51. Specifically, in order to move the secondobject 52 so as to follow the first object 51, the player makes an inputon the follow icon 55 described above (FIG. 4 or 7) using the touchpanel 13 (touches the position of the follow icon 55). When an input ismade on the follow icon 55, the game apparatus 1 controls the movementof the second object 52 based on the position of the first object 51.Specifically, it controls the movement of the second object 52 so as tofollow the first object 51. Therefore, in the present embodiment, evenwhen the second object 52 has moved away from the first object 51, it ispossible to easily move the second object 52 near the first object 51.Note that in the present embodiment, the game apparatus 1 erases thefollow icon 55 at least while an input whose starting position is withinthe path mark 53 is being made on the game space image. That is, thefollow icon 55 is not displayed while the first object 51 is beingcontrolled (FIG. 4, FIG. 7), and the follow icon 55 is displayed whilethe second object 52 is being controlled (FIG. 5, FIG. 6). As describedabove, in the present embodiment, the follow icon 55 is not displayedwhen it is not needed, and it is therefore possible to prevent anerroneous operation by the player and to provide a game image that iseasier for the player to view.

In the present embodiment, the player can switch an object to be thecontrolled object between the objects 51 and 52. Specifically, in orderto switch objects from one to another, the player makes an input on theswitch icon 54 (FIG. 3, etc.) using the touch panel 13 (touches theposition of the switch icon 54). When an input is made on the switchicon 54, the game apparatus 1 switches between a state where a displayarea is set so that the first object 51 is included in the game spaceimage displayed on the lower LCD 12 and another state where a displayarea is set so that the second object 52 is included in the game spaceimage. In the present embodiment, one of the first and second objects 51and 52 may move out of the display area of the lower LCD 12 so that bothof the objects cannot be displayed on the lower LCD 12 at the same time.Even in such a case, the player can easily keep, displayed on the lowerLCD 12, one of the objects 51 and 52 that the player wishes to bedisplayed (one that the player wishes to control).

In the present embodiment, the game apparatus 1 displays a map imagerepresenting a greater area than the area represented by the game spaceimage on the upper LCD 22. FIG. 10 is a diagram illustrating a gameimage displayed on the upper LCD 22 of the game apparatus 1. As shown inFIG. 10, the upper LCD 22 displays a mark 61 representing the firstobject 51 and a mark 62 representing the second object 52, superimposedon the map image. Moreover, when there is an inputted path for movingthe second object 52 therealong, the path 63 is displayed, superimposedon the map image. Thus, the player can visually check inputted pathsalso on the map image.

In the present embodiment, the game apparatus 1 sometimes controls thesecond object 52, moving along a path, to perform a predeterminedaction. An action performed by the second object 52 midway through themovement along a path is herein referred to as a “mid-path action”. FIG.11 is a diagram illustrating a game image while the second object 52 ismoving along the path 56. Note that although FIG. 11 shows a game imagewhere the first object 51 is absent for an easier understanding of thefigure, the first object 51 may be included in the game image (thissimilarly applies also to FIGS. 12 to 15).

In FIG. 11, an enemy object 66 is present near the second object 52moving along the path 56. If the second object 52 comes near the enemyobject 66 while moving along the path 56, the second object 52 performsa mid-path action of attacking the enemy object 66. Hereinafter, anobject that is a target of a mid-path action is referred to as a “targetobject”. A target object may be the enemy object 66 as shown in FIG. 11,or may be an item object or an unmovable object placed in the game spacesuch as a rock. A mid-path action of the second object 52 against atarget object is not controlled by the player's operation, but iscontrolled automatically by the game apparatus 1.

FIG. 12 is a diagram illustrating a game image at a point in time whenthe second object 52 finishes a mid-path action. In FIG. 12, the secondobject 52 is present at a position away from the path 56 at the finishof the mid-path action against the enemy object 66 (i.e., when the enemyobject 66 is defeated). Since a mid-path action is not performed basedon the path 56, the position of the second object 52 may be away fromthe path 56, as shown in FIG. 12, at the finish of the mid-path action.In this case, the game apparatus 1 returns (moves) the second object 52to a position along the path 56, and resumes the movement along the path56.

Specifically, when the mid-path action is finished, the game apparatus 1determines the return position, which is the position at which theobject, having finished the action, returns to the path 56. Note that inthe present embodiment, the return position is determined based on theposition of the object having finished the mid-path action and theposition of the path 56 in the game space, details of which will followlater. Then, the game apparatus 1 resumes the movement along the path 56after returning (moving) the second object 52, having finished themid-path action, to the return position. Thus, the movement of thesecond object 52 along the path 56 is carried out up to the end point ofthe path 56 even if the second object 52 performs a mid-path action.

As described above, according to the present embodiment, the secondobject 52 resumes moving along the path 56 even if the second object 52performs a mid-path action away from the path 56. Therefore, even ifamid-path action is performed, the player does not need to again input apath, and the second object 52 can be moved up to the end of the path,which has been inputted before the mid-path action. Therefore, accordingto the present embodiment, the player is allowed to input a path formoving an object therealong in a simpler operation than that in theprior art where the player needs to input a path anew each time amid-path action is performed.

Next, the process of determining the return position will be described.Note that in the present embodiment, the game apparatus 1 uses, in theprocess of determining the return position, a plurality of registeredpoints selected along the path 56 for the purpose of making this processeasier and faster. That is, the game apparatus 1 stores, as registeredpoints, one or more points along the path 56 that have been inputted ata predetermined time interval. Points P1 to P10 shown in FIGS. 11 to 15are registered points. The return position is selected from among theseregistered points.

When a mid-path action described above is performed, the game apparatus1 stores, as the “original point”, the position (a registered point) ofthe second object 52 at the start of the mid-path action. Stored as theoriginal point is one of the registered points already passed over bythe second object 52 that is closest to the position of the secondobject 52 at the start of the mid-path action. In the example shown inFIG. 11, since the position of the second object 52 at the start of themid-path action is between the registered points P2 and P3, theregistered point P2 is stored as the original point.

When the mid-path action is finished, the game apparatus 1 selects, as a“nearest point”, a registered point that can be reached within theshortest amount of time from the position of the second object 52 at thefinish of the mid-path action. In FIG. 12, the registered point P6,which is closest to the position of the second object 52 at the finishof the mid-path action is selected as the “nearest point”.

Once the nearest point is selected, the game apparatus 1 determineswhether or not the nearest point is a position equal or subsequent tothe original point along the path. In the present specification, therelative position of a point along a path is represented based on thetime at which the second object 52 passes through the point along thepath. That is, “position B being equal or subsequent to position A”means that “the second object 52 passes through position B after passingthrough position A”. Similarly, “the nearest point being at a positionprior to the original point” means that “the second object 52 hasalready passed through the nearest point”.

If the nearest point is at a position equal or subsequent to theoriginal point, the game apparatus 1 determines the position of thenearest point to be the return position (return point). Therefore, thesecond object 52, having finished the mid-path action, moves to thenearest point and then resumes moving along the path 56. For example, inthe case of FIG. 12, since the nearest point P6 is positioned subsequentto the original point P2, the second object 52 moves to the nearestpoint P6, and resumes moving along the path 56 starting from the nearestpoint P6.

As described above, in the present embodiment, the game apparatus 1determines the return position based on a “reaching time” (or “reachingdistance”) that is needed to reach the position from the position of thesecond object 52 having finished the mid-path action. Specifically, inthe case of FIG. 12, a registered point that can be reached within theshortest amount of time from the position of the second object 52 havingfinished the mid-path action is selected as the return point. If theposition of the original point were selected as the return point in thegame state shown in FIG. 12, the second object 52, which has alreadyadvanced near the registered point P6, would return to the position ofthe original point P2 away from the current position (the position atthe finish of the mid-path action) and then advance from the originalpoint P2 to the position of the registered point P6. In such a case, thesecond object 52 moves insufficiently, and the movement requires a longtime, thus frustrating the player. In contrast, according to the presentembodiment, the second object 52 can be quickly returned to the path 56,and the second object 52 can be moved efficiently.

Note that in the present embodiment, the nearest point is a registeredpoint that can be reached within the shortest amount of time from theposition of the second object 52 at the finish of the mid-path action.Therefore, if an obstacle, or the like, is present between the positionat the finish of the mid-path action and a registered point that isclosest to that position, the registered point may not be the nearestpoint. FIG. 13 is a diagram illustrating another example of a game imageat a point in time when the second object 52 finishes a mid-path action.In FIG. 13, there is a pond 67 (it is assumed herein that the secondobject 52 cannot pass through a pond) between the position of the secondobject 52 at the finish of the mid-path action and the registered pointP3, which is closest to that position. Then, the game apparatus 1selects the nearest point from among the registered points P1 to P10while excluding the registered points P3 to P5, which cannot be reachedwithout detouring around the pond 67. As a result, in the case of FIG.13, the registered point P7 is selected as the nearest point. Asdescribed above, by selecting the nearest point based on the reachingtime that is needed to reach the position from the position at thefinish of the mid-path action, it is possible to more accurately selecta registered point that can be reached by the second object 52 withinthe shortest amount of time.

Note that in the present embodiment, the game apparatus 1 does notalways select the position of the nearest point as the return point, butmay alternatively select the position of the original point as thereturn point depending on the circumstances. That is, if the nearestpoint is a position prior to the original point (if the nearest point isnot a position equal or subsequent to the original point), the gameapparatus 1 determines the original point to be the return point. FIG.14 is a diagram illustrating another example of a game image at a pointin time when the second object 52 finishes a mid-path action. In FIG.14, assume that the nearest point is the registered point P1, and theoriginal point is the registered point P2. Then, the registered point P2is determined to be the return point, and the second object 52, havingfinished a mid-path action, moves to the registered point P2 and thenresumes moving along the path 56.

As described above, in the present embodiment, the game apparatus 1determines the return position (return point) so that the returnposition is a position equal or subsequent to the original point (withrespect to the direction in which the second object 52 advances). If theregistered point P1, being the nearest point, were determined to be thereturn point in the game state shown in FIG. 14, the second object 52would again pass through the registered points P1 to P2. Therefore, dueto the inefficient movement, in which the second object 52 passesthrough the same path twice, the player may be frustrated. In contrast,in the present embodiment, the second object 52 will not pass throughpath portions that it has once passed through, and it is thereforepossible to efficiently move the second object 52.

Note that in other embodiments, the game apparatus 1 may alwaysdetermine the nearest point to be the return position, or may alwaysdetermine the original point to be the return position. For example, ina case where it is necessary to quickly return the second object 52 ontothe path due to the game settings (e.g., a case where a character canattack an enemy character only when located on the path), it isadvantageous to always determine the nearest point to be the returnposition. In a case where it is desirable that the second object 52 ismoved faithfully along the path inputted by the player, it isadvantageous to always determine the original point to be the returnposition.

In the present embodiment, some of the target objects triggerpredetermined event actions as mid-path actions. Herein, a target objectthat triggers a predetermined event action is referred to as an “eventobject”, and the position of an event object is referred to as the“event position”. The game apparatus 1 controls the second object 52 toperform an event action as a mid-path action when the event position setin the game space and the position of the second object 52 come into apredetermined positional relationship. Note that not all of the targetobjects described above are set to be event objects, but onlypredetermined target objects are set as event objects. For example,enemy objects and normal item objects may not be set as event objects,while item objects and gimmick objects that are important to theprogress of the game are set as event objects. For example, an object ofan item that must be obtained in order to progress in the game and anobject of a switch for opening a door that must be opened to advance anyfurther are set as event objects.

In the present embodiment, the game apparatus 1 determines a returnposition along the path so that the return position is equal or prior toa position at which the second object 52 performs the event action. Thedetails of this will now be described.

The game apparatus 1 sets, as a “priority point”, any one of positions(registered points) along the path at which the second object 52performs the event action. Specifically, a priority point is aregistered point with an event object present in the vicinity thereof,and in other words, is a registered point that triggers an event actionwhen it is passed over by the second object 52.

FIG. 15 is a diagram illustrating a game image where priority points areset. In FIG. 15, a pot object 68 and a treasure chest object 69, whichare event objects, are placed in the game space. When the second object52 comes near the pot object 68, the second object 52 performs, as amid-path action, an action of picking up a key out of the pot, and whenthe second object 52 comes near the treasure chest object 69, the secondobject 52 performs, as a mid-path action, an action of opening thetreasure chest using the key. In FIG. 15, the player has inputted thepath 56, which passes near the pot object 68 and then passes near thetreasure chest object 69. Then, the game apparatus 1 sets, as prioritypoints, the registered point P4 within a predetermined distance from thepot object 68 and the registered point P10 within a predetermineddistance from the treasure chest object 69.

Assume that the game state shown in FIG. 15 is where the second object52 has finished a mid-path action with the registered point P2 being theoriginal point. Then, as described above, the game apparatus 1determines the registered point P6 to be the nearest point, and if thenearest point is a position prior to the original point, the gameapparatus 1 determines the original point to be the return point.

If the nearest point P6 is determined to be the return point, the secondobject 52 will skip a priority point, and the second object 52 will notperform the action of picking up a key out of a pot. However, if thepath 56 has been inputted as shown in FIG. 15, it can be presumed thatthe player has inputted the path 56 intending to control the secondobject 52 to perform an action of first picking up the key out of thepot and then going to, and opening, the treasure chest. Therefore, ifthe second object 52, having finished a mid-path action, skips thepriority point when returning to the path, the action of the secondobject 52 is against the intention of the player.

In view of this, in the present embodiment, the game apparatus 1determines a return point so that it is a position equal or prior to anypriority point. That is, the game apparatus 1 determines (where thenearest point is not a position prior to the original point) whether ornot the nearest point is a position subsequent to any priority point.Then, if the nearest point is a position subsequent to any prioritypoint, the game apparatus 1 does not select the nearest point as thereturn point, but determines the original point to be the return point.If the nearest point is a position equal or prior to any priority point(if the nearest point is not a position subsequent to any prioritypoint), the game apparatus 1 determines the nearest point to be thereturn point. Therefore, in the case shown in FIG. 15, since the nearestpoint P6 is a position subsequent to the priority point P4, the originalpoint P2 is selected as the return point. In this way, the second object52, having performed a mid-path action, will not return to a registeredpoint that is equal or subsequent to a priority point while skipping thepriority point, and it is thus possible to ensure that the second object52 passes through the priority point. Therefore, it is possible tocontrol the second object 52 to perform an action as intended by theplayer, and it is possible to provide a game with a goodcontrollability.

[Details of the game process] Hereinafter, the game process to beexecuted by the game program according to the present embodiment will bedescribed in detail with reference to FIGS. 16 to 23. First, variousdata to be used in the game process will be described. FIG. 16 is adiagram illustrating data stored in the main memory 32 of the gameapparatus 1. In FIG. 16, the main memory 32 has stored therein a gameprogram 71 and game process data 72 according to the present embodiment.

The game program 71 is a program for causing the CPU 31 of the gameapparatus 1 to execute the game process to be described later (FIG. 17).The game program 71 may be stored to the main memory 32 by being readfrom the memory card 29 at a suitable time or being acquired viacommunication with any device external to the game apparatus 1.

The game process data 72 is data to be used in the game process to bedescribed later (FIG. 17). The game process data 72 includes touch inputdata 73, input path data 74, registered path data 75, registered pointdata 76, original point data 77, nearest point data 78, priority pointdata 79, return point data 80, first object data 81, second object data82, path mark data 83, path display flag data 84, follow flag data 85,controlled object flag data 86, and action flag data 87. Note that thegame process data 72 includes data required for the game process, suchas image data of various objects and icons appearing in the game anddata representing parameters set for various objects, in addition to thedata shown in FIG. 16.

The touch input data 73 is data obtained from the touch panel 13 as thetouch position data. Specifically, the touch input data 73 representsthe coordinates of the position (touch position) at which an input hasbeen made if the player has made an input on the touch panel 13, andindicates that no input has been made if the player has made no input onthe touch panel 13.

The input path data 74 is data representing a path that is inputted onthe touch panel 13. Specifically, the input path data 74 represents (inthe order of input) the coordinates of one or more touch positions thatare inputted successively. That is, if the player has made an input bydrawing a path on the touch panel 13, the main memory 32 stores, as thetouch input data 73, data that represents, in the order of input, thecoordinates of the points of the path.

The registered path data 75 is data representing a path that isregistered as a path for moving the second object 52 therealong. Asdescribed above, in the present embodiment, not all paths inputted bythe player are used for moving the second object 52, but only thosepaths whose starting points are located within the path mark 53 are usedfor moving the second object 52. That is, data representing a path,among all paths inputted by the player, whose starting point is locatedwithin the path mark 53 is stored in the main memory 32 as theregistered path data 75.

The registered point data 76 is data representing one or more registeredpoints set along a path inputted by the player. Specifically, registeredpoints are one or more touch positions extracted at an interval of apredetermined number of positions (e.g., one for every 100 positions)from among all the touch positions (arranged in the order of input)represented by the registered path data 75. Therefore, it can be saidthat registered points are those of all points of a path that areinputted at a predetermined time interval. Note that in otherembodiments, the game apparatus 1 may extract, as registered points,those of all points of a path that are inputted at a predetermineddistance interval. In the present embodiment, the game apparatus 1stores, as the registered point data 76, data obtained by numbering theextracted registered points in the order of input.

The original point data 77 is data representing the original pointdescribed above. In the present embodiment, since each registered pointis numbered, the original point data 77 is data representing the numberattached to the original point. The nearest point data 78 is datarepresenting the nearest point described above, the priority point data79 is data representing the priority point described above, and thereturn point data 80 is data representing the return point describedabove. The nearest point data 78, the priority point data 79 and thereturn point data 80 each represent a number attached to the registeredpoint, as does the original point data 77.

The first object data 81 is data representing various parameters set forthe first object 51. The second object data 82 is data representingvarious parameters set for the second object 52. In the presentembodiment, the parameters include information representing the positionof the first object 51 (or the second object 52) in the game space. Inaddition, the parameters may include information representing the hitpoint value and the ability value of the first object 51 (or the secondobject 52).

The path mark data 83 is data representing the position of the path mark53. In the present embodiment, the path mark 53 is an object placed inthe virtual game space, and the path mark data 83 represents theposition coordinates in the game space. The position of the path mark 53is determined based on the position of the second object 52 representedby the second object data 82.

The path display flag data 84 is data representing contents (whether itis ON or OFF) of the path display flag. The path display flag representswhether or not to display a path for moving the second object 52therealong. That is, the path display flag is set to be ON where thepath is displayed, and the path display flag is reset to be OFF wherethe path is not displayed.

The follow flag data 85 is data representing the contents (whether it isON or OFF) of the follow flag. The follow flag represents whether or notthe player has given an instruction for the second object 52 to followthe first object 51. That is, the follow flag is set to be ON if theplayer has given the instruction, and the follow flag is reset to be OFFif the player has not given the instruction.

The controlled object flag data 86 is data representing the contents(whether it is ON or OFF) of the controlled object flag. The controlledobject flag represents whether the object controlled by the player isthe first object 51 or the second object 52. That is, the controlledobject flag is set to be ON if the object controlled by the player isthe second object 52, and the controlled object flag is reset to be OFFif the object controlled by the player is the first object 51.

The action flag data 87 is data representing the contents (whether it isON or OFF) of the action flag. The action flag represents whether or notthe second object 52 is performing a mid-path action described above.That is, the action flag is set to be ON if the second object 52 isperforming a mid-path action, and the action flag is reset to be OFF ifthe second object 52 is not performing a mid-path action.

Next, the game process to be performed in the game apparatus 1 will bedescribed in detail with reference to FIGS. 17 to 23. FIG. 17 is a mainflowchart illustrating the flow of the game process to be executed inthe game apparatus 1. When the power button 14F is pressed to turn ONthe game apparatus 1, the CPU 31 of the game apparatus 1 initializes themain memory 32 and other elements, and thereafter starts executing thegame program 71 for performing the game process shown in FIG. 17. As thegame program 71 is executed, the CPU 31 serves as various means recitedin the claims. That is, the game program 71 controls the CPU 31 to serveas various means recited in the claims.

First, in step S1, the CPU 31 performs an initialization process.Specifically, a virtual game space is created, and objects (includingthe first and second objects 51 and 52) to appear in the game space areplaced at their initial positions. Therefore, the first object data 81stored in the main memory 32 is set so as to represent the initialposition of the first object 51, and the second object data 82 is set soas to represent the initial position of the second object 52. The CPU 31displays an image of the game space with the objects placed at theirinitial positions on the lower LCD 12, and displays a map image of apredetermined area including the game space on the upper LCD 22.Moreover, the CPU 31 sets initial values for various parameters andvarious flags to be used in the game process. The path display flag data84 is reset to be OFF, the follow flag data 85 is reset to be OFF, thecontrolled object flag data 86 is reset to be OFF, and the action flagdata 87 is reset to be OFF. The process of step S2 is executed,following step S1. In the following description, the process loopthrough steps S2 to S9 is iterated once in a predetermined amount oftime (e.g., 1/60 sec).

In step S2, the CPU 31 accepts a game operation input from the player.Specifically, the CPU 31 obtains touch position data from the touchpanel 13, and stores it in the main memory 32 as the touch input data73. Note that in the present embodiment, touch position data that hasbeen obtained in step S2 in the previous iteration is saved (stored) inthe main memory 32.

In step S2, the CPU 31 further executes a process of updating the inputpath data 74 stored in the main memory 32. As described above, the inputpath data 74 represents (in the order of input) the coordinates of oneor more touch positions that are inputted successively. The updatingprocess is a process for detecting a path that has been inputted on gamespace image using the touch panel 13. Specifically, the CPU 31 updatesthe input path data 74 by the following process.

First, if the touch position represented by the touch position dataobtained in step S2 is a starting position of an input (if the touchposition data obtained in step S2 in the previous iteration indicatesthat no input had been made), the CPU 31 resets the contents of theinput path data 74. Specifically, the CPU 31 erases the contents ofcurrent input path data 74, and stores the touch position data obtainedin step S2 as updated, new input path data 74 in the main memory 32. Ifthe touch position represented by the touch position data obtained instep S2 is not a starting position of an input, the CPU 31 updates theinput path data 74 so that this touch position is added thereto. Thatis, the input path data 74 is updated so as to represent contentsobtained by adding the touch position represented by the touch positiondata obtained in step S2 to the set of one or more touch positionsrepresented by the input path data 74 before the update. Note that ifthe touch position data obtained in step S2 indicates that no input hasbeen made on the touch panel 13, the input path data 74 is not updated.

In step S3, following step S2, the CPU 31 executes an inputdetermination process. The input determination process is a process ofdetermining what instruction is intended by a touch input operation bythe player (e.g., whether the input operation is one for moving thesecond object 52, one for controlling the first object 51 to perform anaction, etc.). Referring to FIG. 18, the details of the inputdetermination process will now be described.

FIG. 18 is a flow chart illustrating the flow of the input determinationprocess (step S3) shown in FIG. 17. First, in step S11 of the inputdetermination process, the CPU 31 determines whether or not a touchinput has been newly started. The determination of step S11 can be madeby referring to the current touch position data (the touch position dataobtained in step S2 in the current iteration) and the previous touchposition data (the touch position data obtained in step S2 in theprevious iteration). That is, the CPU 31 determines that a touch inputhas been newly started if the current touch position data represents atouch position (instead of indicating that no input has been made), andif the previous touch position data indicates that no input had beenmade. In contrast, the CPU 31 determines that a touch input has not beennewly started, if the current touch position data indicates that noinput has been made, or if the previous touch position data represents atouch position. If the determination result from step S11 isaffirmative, the process of step S12 is executed. If the determinationresult from step S11 is negative, the CPU 31 exits the inputdetermination process.

In step S12, the CPU 31 determines whether or not an input has been madeon the follow icon 55. The determination of step S12 is made based onwhether or not the current touch position (the touch input startingposition) is within the area of the follow icon 55 on the input screenof the touch panel 13 (the display screen of the lower LCD 12). That is,the CPU 31 reads out the touch input data 73 from the main memory 32,and determines whether or not the touch position represented by thetouch input data 73 is within the area in which the follow icon 55 isdisplayed. Note that the area in which the follow icon 55 is displayedis predetermined. If the determination result from step S12 isaffirmative, the process of step S13 is executed. If the determinationresult from step S12 is negative, the process of step S14 to bedescribed later is executed.

In step S13, the CPU 31 sets the follow flag to be ON. That is, the CPU31 updates the contents of the follow flag data 85 stored in the mainmemory 32 so that the flag is ON. After step S13, the CPU 31 exits theinput determination process.

In step S14, the CPU 31 determines whether or not an input has been madeon the switch icon 54. The determination of step S14 is made based onwhether or not the current touch position is within the area of theswitch icon 54 on the input screen of the touch panel 13 (the displayscreen of the lower LCD 12). That is, the CPU 31 reads out the touchinput data 73 from the main memory 32, and determines whether or not thetouch position represented by the touch input data 73 is within the areaof the switch icon 54. Note that the area in which the switch icon 54 isdisplayed is predetermined. If the determination result from step S14 isaffirmative, the process of step S15 is executed. If the determinationresult from step S14 is negative, the process of step S16 to bedescribed later is executed.

In step S15, the CPU 31 toggles the controlled object flag. That is, theCPU 31 reads out the controlled object flag data 86 from the main memory32, and updates the contents of the controlled object flag data 86 sothat the flag is turned OFF if it is ON, and vice versa. After step S15,the CPU 31 exits the input determination process.

In step S16, the CPU 31 determines whether or not an input has been madeon the path mark 53. The determination of step S16 is made whether ornot the current touch position is within the area of the path mark 53 onthe input screen of the touch panel 13 (the display screen of the lowerLCD 12). The CPU 31 reads out the touch input data 73 and the path markdata 83 from the main memory 32. Then, based on the read-out data, theCPU 31 determines whether or not the current touch position is withinthe area in which the path mark 53 is displayed. If the determinationresult from step S16 is affirmative, the process of step S17 isexecuted. If the determination result from step S16 is negative, theprocess of step S19 is executed.

In step S17, the CPU 31 changes the contents of the path display flag,the follow flag and the controlled object flag. That is, the CPU 31updates the contents of the path display flag data 84 stored in the mainmemory 32 so that the flag is ON. The CPU 31 updates the contents of thefollow flag data 85 stored in the main memory 32 so that the flag isOFF. Moreover, the CPU 31 updates the contents of the controlled objectflag data 86 stored in the main memory 32 so that the flag is ON. Theprocess of step S18 is executed, following step S17.

In step S18, if there is a path that has been registered in step S24 tobe described later, the CPU 31 deletes the path. That is, the CPU 31deletes the registered path data 75 stored in the main memory 32. Inthis process, the CPU 31 also deletes the registered point data 76together with the registered path data 75. After step S18, the CPU 31exits the input determination process.

In step S19, the CPU 31 resets the controlled object flag to be OFF.That is, the CPU 31 updates the contents of the controlled object flagdata 86 stored in the main memory 32 so that the flag is OFF. After stepS19, the CPU 31 exits the input determination process.

As described above, in the input determination process, the CPU 31determines whether or not the detected touch position is a startingposition of an input (step S11), and if the touch position is a startingposition of an input, the CPU 31 determines what instruction is intendedby the touch input. Specifically, the CPU 31 makes the determination asfollows.

1. If the input is an input on the follow icon 55, the CPU 31 determinesthat the input is an instruction for instructing the second object 52 tofollow the first object 51, and accordingly turns ON the follow flag(step S13).

2. If the input is an input on the switch icon 54, the CPU 31 determinesthat the input is an instruction for switching the controlled objectfrom one to another, and accordingly toggles the controlled object flag(step S14).

3. If the input is an input on the path mark 53, the CPU 31 determinesthat the input is an instruction for moving the second object 52 along apath, and accordingly turns ON the path display flag and the controlledobject flag and turns OFF the follow flag (step S17).

4. Otherwise (if the input is an input on the game space image outsidethe path mark 53 and the icons 54 and 55), the CPU 31 determines thatthe input is an instruction for moving the first object 51, andaccordingly turns OFF the controlled object flag (step S19).

Note that in the input determination process, the CPU 31 selects whetherto control the second object 52 or to control the first object 51 basedon an input by the player, depending on whether the starting position ofthe input is within the path mark 53. In other embodiments, theselection can be made based not on the starting position of the input,but on any input position (including a position midway through theinput, and a position at the finish of the input). Specifically, the CPU31 may execute the process through steps S12 to S19 not only when atouch input is started (YES in step S11), but also when the area wherethe input is made switches from one to another (e.g., when the inputposition switches from within the path mark 53 to outside the path mark53). Then, if the player makes a touch input in an area outside the pathmark 53 and then, without discontinuing the touch input, makes an inputin the area within the path mark 53 (if the touch input is moved fromthe outside to the inside of the path mark 53), it can be taken to meanthat the player controls the first object 51 and then continuouslyinputs a path for moving the second object 52 therealong. In this way,the player can control two objects with a single continuous input. Notehowever that there may be circumstances where the player inadvertentlymoves the touch input from the outside to the inside of the path mark53. In view of such circumstances, it may be preferred to make theselection based on the starting position of the input, as in the presentembodiment.

Referring back to FIG. 17, in step S4, following step S3, the CPU 31executes a path setting process. The path setting process is a processfor setting (registering) a path for moving the second object 52therealong, from among paths inputted by the player. Referring to FIG.19, the details of the path setting process will now be described.

FIG. 19 is a flow chart illustrating the flow of the path settingprocess (step S4) shown in FIG. 17. First, in step S21 of the pathsetting process, the CPU 31 determines whether or not a touch input isbeing made in step S2 in the current iteration. Note that thedetermination of step S21 can be made based on whether or not the touchinput data 73 represents a touch position. If the determination resultfrom step S21 is affirmative, the CPU 31 exits the path setting process.If the determination result from step S21 is negative, the process ofstep S22 is executed.

In step S22, the CPU 31 determines whether or not a touch input has justbeen finished. The determination of step S22 can be made by referring tothe touch position data obtained in step S2 in the previous iteration.That is, the CPU 31 determines that a touch input has just been finishedif the touch position data obtained in step S2 in the previous iterationrepresents a touch position, and determines that a touch input has notjust been finished if the touch position data indicates no input hadbeen made. If the determination result from step S22 is affirmative, theprocess of step S23 is executed. If the determination result from stepS22 is negative, the CPU 31 exits the path setting process.

In step S23, the CPU 31 reads out, and refers to, the controlled objectflag data 86 from the main memory 32, so as to determine whether or notthe controlled object flag is set to be ON. The determination process ofstep S23 is a process of determining whether or not a path currentlybeing inputted is a path whose starting position is within the path mark53, or in other words, a process of determining whether or not the pathis a path for moving the second object 52 therealong. If thedetermination result from step S23 is affirmative, the process of stepS24 is executed. If the determination result from step S23 is negative,the CPU 31 exits the path setting process.

In step S24, the CPU 31 sets the path being inputted by the player as apath for moving the second object 52 therealong. Specifically, the CPU31 reads out the input path data 74 from the main memory 32, and storesthe read-out input path data 74 in the main memory 32 as the registeredpath data 75. The process of step S25 is executed, following step S24.

In the path setting process through steps S21 to S24 described above, aninput path is registered if a touch input has just been finished (YES instep S22) and if the controlled object flag is ON (YES in step S23).That is, in the present embodiment, when an input of a path whosestarting position is within the path mark 53 is finished, the path isregistered.

In step S25, the CPU 31 sets registered points for the path registeredin step S24. Specifically, the CPU 31 reads out the registered path data75 from the main memory 32, and extracts touch positions at an intervalof a predetermined number of positions from among all the touchpositions represented by the registered path data 75. In a case wheretouch positions are extracted at an interval of 100 positions, forexample, 1+100 n^(th) (n is an integer of 0 or more) touch positions areextracted from among all the touch positions arranged in the order ofinput. Moreover, the CPU 31 stores in the main memory 32, as theregistered point data 76, data obtained by numbering one or moreextracted touch positions in the order of input. The process of step S26is executed, following step S25.

In step S26, the CPU 31 sets priority points for the registered pointsset in step S25. In the present embodiment, those of the target objectsthat are to be event objects are set in advance, and data representingthe positions of the event objects (event positions) are stored in themain memory 32. The CPU 31 determines whether or not an event positionis present within a predetermined distance for each of the registeredpoints. Note that the predetermined distance is the radius of thespherical search area to be described later. That is, the process ofstep S26 is a process for determining whether or not the second object52 performs an event action when actually reaching the position of theregistered point. Specifically, the CPU 31 reads out the registered pathdata 75 from the main memory 32, and calculates positions in the gamespace corresponding to the touch positions represented by the registeredpath data 75. Then, the CPU 31 determines whether or not an eventposition is present within the predetermined distance from a calculatedposition. Moreover, if there is a registered point from which an eventposition is present within the predetermined distance, the CPU 31 setsthe registered point as a priority point. That is, the CPU 31 storesdata representing the registered point (data representing the numberattached to the registered point) as the priority point data 80 in themain memory 32. Note that in the present embodiment, if it is determinedthat any event position is present within the predetermined distance ofmore than one registered point, one of the registered points (e.g., thelast registered point along the path) is set as the priority point.After step S26, the CPU 31 exits the path setting process.

Note that in the path setting process, in response to the completion ofthe input of a path (YES in steps S22 and S23), priority points are setfor the path. Since priority points to be set along a path can bedictated once the path is determined, priority points are preferably set(stored) every time a path is inputted, as in the present embodiment.Note that although the timing for setting priority points is uponcompletion of the input of a path in the present embodiment, the CPU 31may execute the process of step S26 at a timing when the second object52 starts a mid-path action (a timing when the action flag is turned ON)or at a timing immediately before a return point determination process(S52) is executed, in other embodiments.

Referring back to FIG. 17, in step S5, following step S4, the CPU 31determines whether or not the controlled object flag is set to be ON.The determination process of step S5 is the same as the determinationprocess of step S22 described above. If the determination result fromstep S5 is negative, the process of step S6 is executed. If thedetermination result from step S5 is affirmative, the process of step S7to be described later is executed.

In step S6, the CPU 31 controls the action of the first object 51 basedon the player's input. In the present embodiment, the CPU 31 moves thefirst object 51 toward a position (in the game space) corresponding tothe touch position. Specifically, the CPU 31 first reads out the firstobject data 81 and the touch input data 73 from the main memory 32, andcalculates the position in the game space corresponding to the touchposition represented by the touch input data 73. Then, the CPU 31updates the first object data 81 so that the new position of the firstobject 51 is a position obtained by shifting the current positionrepresented by the first object data 81 by a predetermined distancetoward the calculated position. Data representing the updated positionis stored in the main memory 32 as the first object data 81. The firstobject 51 can be moved at a predetermined speed by iterating theupdating process described above over a plurality of frames (byiterating the process loop through steps S2 to S9 a plurality of times).The process of step S7 is executed, following the process of step S6.

In the present embodiment, the game apparatus 1 controls the action ofthe first object 51 based on the input made by using the touch panel 13,as in step S6. Therefore, the player can control both the first object51 and the second object 52 using the touch panel 13. Note that in stepS6, the CPU 31 executes a process of moving the first object 51 toward aposition in the game space corresponding to the touch position, as anexample of a process of controlling the action of the first object 51.In other embodiments, the action of the first object 51 performed basedon the player's input may be any other suitable action. For example, theCPU 31 may control the first object 51 based on the shape of the pathinputted by the player or the direction of the (linear) path inputted bythe player.

In step S7, the CPU 31 executes a second object control process. Thesecond object control process is a process of controlling the movementof the second object 52 based on the player's input. Referring to FIG.20, the details of the second object control process will now bedescribed.

FIG. 20 is a flow chart illustrating the flow of the second objectcontrol process (step S7) shown in FIG. 17. First, in step S31 of thesecond object control process, the CPU 31 determines whether or not apath has been registered in (whether or not there is a registered pathfrom) step S24 in the path setting process (step S4). The determinationof step S31 can be made based on whether or not the registered path data75 is stored in the main memory 32. If the determination result fromstep S31 is affirmative, the process of step S32 is executed. If thedetermination result from step S31 is negative, the process of step S35to be described later is executed.

In step S32, the CPU 31 performs a move-along-path process. Themove-along-path process is a process for moving the second object 52along a path. Referring to FIG. 21, the details of the move-along-pathprocess will now be described.

FIG. 21 is a flow chart illustrating the flow of the move-along-pathprocess (step S32) shown in FIG. 20. First, in step S41 of themove-along-path process, the CPU 31 determines whether or not a returnpoint has been set. In the present embodiment, a return point is set(step S52 to be described later), when the second object 52 returns tothe path after finishing a mid-path action described above. That is, theprocess of step S41 is a process for determining whether or not thesecond object 52 is on the way back to the path. Specifically, the CPU31 determines whether or not the return point data 80 is stored in themain memory 32. If the determination result from step S41 isaffirmative, the process of step S42 is executed. If the determinationresult from step S41 is negative, the process of step S53 to bedescribed later is executed.

In step S42, the CPU 31 reads out, and refers to, the action flag data87 from the main memory 32, so as to determine whether or not the actionflag is set to be ON. The determination process of step S42 is a processfor determining whether or not the second object 52 is in the process ofperforming a mid-path action. If the determination result from step S42is affirmative, the process of step S47 to be described later isexecuted. If the determination result from step S42 is negative, theprocess of step S43 is executed.

The determination result from step S42 being negative means that thesecond object 52 is moving along the path. Therefore, in steps S43 toS46, a process for moving the second object 52 along the path isexecuted. The details of this will now be described.

In step S43, the CPU 31 moves the second object 52 along the path.Specifically, the CPU 31 first reads out the second object data 82 andthe registered path data 75 from the main memory 32. Then, the CPU 31updates the position of the second object 52 represented by the secondobject data 82 to a position obtained by advancing the current positionby a predetermined distance along the path represented by the registeredpath data 75 in the direction in which the path has been inputted. Datarepresenting the updated position of the second object 52 is stored inthe main memory 32 as the new second object data 82. The second object52 can be moved along the path at a predetermined speed by iterating theupdating process described above over a plurality of frames (byiterating the process loop through steps S2 to S9 a plurality of times).The process of step S44 is executed, following the process of step S43.

In step S44, the CPU 31 determines whether or not a target object ispresent within a search area defined with reference to the second object52. In the present embodiment, the search area is set with respect tothe second object 52. The search area is a spherical area centered aboutthe position of the second object 52 (or the object of the path mark53), and is not displayed on the screen. Specifically, the CPU 31 readsout the second object data 82 from the main memory 32, and determineswhether or not a target object is present within a predetermineddistance (within the search area) with respect to the position of thesecond object 52 represented by the second object data 82. If thedetermination result from step S44 is affirmative, the process throughsteps S45 and S46 is executed. If the determination result from step S44is negative, the CPU 31 exits the move-along-path process, whileskipping the process through steps S45 and S46.

The process of step S44 is a process for determining whether or not tocontrol the second object 52 to perform a mid-path action. While thesearch area is a spherical area centered about the position of thesecond object 52 in step S44 described above, the search area may be anyarea as long as it is set with reference to the position of the secondobject 52, as are areas used in collision detection processes ingeneral. The search area is not limited to a spherical area, but may beof, for example, a cylindrical shape, a columnar shape with fan-shapedbase, and the like. If there are different objects that move alongpaths, the size and/or shape of the search area may vary among theobjects.

In step S45, the CPU 31 stores the original point. Specifically, the CPU31 reads out the registered point data 76 and the second object data 82from the main memory 32. Then, the CPU 31 selects one of the registeredpoints represented by the registered point data 76 that is prior to (orsubsequent to) the position of the second object 52 represented by thesecond object data 82 and that is closest to that position. Datarepresenting the selected registered point is stored in the main memory32 as the original point data 77. The process of step S46 is executed,following step S45.

In step S46, the CPU 31 turns ON the action flag. That is, the CPU 31updates the contents of the action flag data 87 stored in the mainmemory 32 so that the flag is ON. Because of the process of step S46,the determination result from step S42 will be affirmative in themove-along-path process to be executed next, and therefore the processfor controlling the second object 52 to perform a mid-path action (stepsS47 to S52) is executed. After step S46, the CPU 31 exits themove-along-path process.

Note that in steps S44 to S46, if a target object is present within thesearch area, the action flag is always ON so that the second object 52performs amid-path action. In contrast, in other embodiments, the CPU 31may set other conditions for performing a mid-path action. For example,conditions may be set such that the second object 52 does not perform amid-path action if the second object 52 has a particular item (e.g., thesecond object 52 does not attack while carrying a rock). In contrast,conditions may be set such that the second object 52 does not perform amid-path action if the second object 52 does not have a particular item(e.g., the second object 52 does not perform an action of opening atreasure chest if the second object 52 does not have a key).

In steps S44 to S46 described above, when the positional relationshipbetween the position of the second object 52 and the position of anothertarget object satisfies a predetermined condition, the CPU 31 controlsthe second object 52 to perform a mid-path action. In other embodiments,the condition for controlling the second object 52 to perform a mid-pathaction is not limited to this, and may be any other suitable condition.For example, the CPU 31 may set, in advance, a predetermined position inthe game space (not limited to a position where an object is placed) atwhich the CPU 31 controls the second object 52 to perform a mid-pathaction. Then, the CPU 31 may control the second object 52 to perform amid-path action when the positional relationship between the position ofthe second object 52 and the predetermined position satisfies apredetermined condition.

The determination result from step S42 being affirmative means that thesecond object 52 is performing a mid-path action. Therefore, throughsteps S47 to S52, which are executed when the determination result fromstep S42 is affirmative, a process for controlling the second object 52to perform a mid-path action is executed. The details of this will nowbe described.

In step S47, the CPU 31 controls the second object 52 to perform amid-path action. The specific action of the mid-path action isdetermined based on the type of the target object that is present withinthe search area at a point in time when the action flag was turned ON.For example, if the target object is an enemy object, the CPU 31controls the second object 52 to perform an action of attacking theenemy object. If the target object is an item object, the CPU 31controls the second object 52 to perform an action of obtaining theitem, an action of carrying the item, or the like. Note that althoughthe entire mid-path action is automatically controlled by the CPU 31 inthe present embodiment, the player may be allowed to control part of themid-path action in other embodiments. For example, regarding the actionof attacking an enemy object, the action of moving toward the enemyobject may be controlled by the CPU 31, with the action of swinging asword at the enemy object being controlled by the player's input. Notethat the CPU 31 controls the second object 52 to perform one frame'sworth of the action in each iteration of the process of step S42. Theprocess of step S48 is executed, following step S47 described above.

In step S48, the CPU 31 determines whether or not the mid-path action bythe second object 52 is finished. In the present embodiment, the CPU 31determines that the mid-path action is finished when the objective ofthe mid-path action has been achieved or when a predetermined limitamount of time has elapsed since the start of the mid-path action. Notethat achieving the objective of the mid-path action means, for example,defeating an enemy object, or obtaining an item object. In the presentembodiment, a time limit is set for a mid-path action, considering thepossibility that the objective of a mid-path action may become no longerachievable, e.g., when an enemy object has run away. As described above,the concept of “an action by an object being finished” as used in thepresent specification not only includes cases where an action isfinished by achieving the objective of the action, but also includescases where the action is discontinued (without achieving the objectiveof the action). If the determination result from step S48 isaffirmative, the process of step S49 is executed. If the determinationresult from step S48 is negative, the CPU 31 exits the move-along-pathprocess.

In step S49, the CPU 31 turns OFF the action flag. That is, the CPU 31updates the contents of the action flag data 87 stored in the mainmemory 32 so that the flag is OFF. Note that when the process of stepS49 is executed, a return point is set by a return point determinationprocess (step S52) to be described later. Therefore, in themove-along-path process to be executed next, the determination resultfrom step S41 will be affirmative, and therefore the process forreturning the second object 52 onto the path (steps S53 to S55) will beexecuted. The process of step S50 is executed, following step S49.

In step S50, the CPU 31 determines whether or not the mid-path action,which has been determined as being finished in step S48, is an eventaction. The determination of step S50 can be made, for example, based onthe change in the status of the event object through the event action bythe second object 52, e.g., the event object being deleted or moved bybeing obtained by the second object 52. The determination process ofstep S50 is a process for determining whether or not an event action hasfinished, i.e., whether or not the second object 52 has cleared anevent. If the determination result from step S50 is affirmative, theprocess of step S51 is executed. If the determination result from stepS50 is negative, the process of step S52 is executed, while skipping theprocess of step S51.

In step S51, the CPU 31 deletes a priority point. The priority point tobe deleted in the process of step S51 is the priority pointcorresponding to an event action that has been determined in step S50 asbeing finished. Specifically, the CPU 31 deletes, from the main memory32, the priority point data 80 representing the priority point to bedeleted. The process of step S52 is executed, following step S51.

In step S52, the CPU 31 performs a return point determination process.The return point determination process is a process for determining areturn point selected from among the registered points. Referring toFIG. 22, the details of the return point determination process will nowbe described.

FIG. 22 is a flow chart illustrating the flow of the return pointdetermination process (step S52) shown in FIG. 21. First, in step S61 ofthe return point determination process, the CPU 31 selects a nearestpoint. As described above, in the present embodiment, the nearest pointis a registered point that can be reached within the shortest amount oftime from the current position of the second object 52 (the position atthe finish of the mid-path action). Specifically, the CPU 31 reads outthe registered point data 76 and the second object data 82 from the mainmemory 32. Then, the CPU 31 selects one of the registered pointsrepresented by the registered point data 76 that can be reached withinthe shortest amount of time from the position of the second object 52represented by the second object data 82. The specific method forselecting a registered point that can be reached within the shortestamount of time may be any suitable method. For example, the CPU 31 mayfirst exclude any registered point such that an obstacle is presentbetween the registered point and the position of the second object 52,and select one of the remaining registered points that is at theshortest distance from the position of the second object 52. Where themoving speed of the second object 52 varies depending on the terrain ofthe game space, the CPU 31 may calculate the amount of time required formoving from the position of the second object 52 to each registeredpoint so as to select a registered point that can be reached within theshortest amount of time. Where it is presumed that no obstacle, or thelike, is present in the game space, the CPU 31 may simply select one ofthe registered points that is at the shortest distance from the positionof the second object 52. Data representing the selected registered pointis stored in the main memory 32 as the nearest point data 78. Theprocess of step S62 is executed, following step S61 described above.

In step S62, the CPU 31 determines whether or not the nearest point is aposition equal or subsequent to the original point along the path. Thedetermination of step S62 can be made easily by referring to numbersattached to the registered points. That is, the CPU 31 reads out theoriginal point data 77 and the nearest point data 78 from the mainmemory 32, and determines whether the nearest point or the originalpoint is subsequent to the other along the path by comparing the numberrepresented by the original point data 77 with the number represented bythe nearest point data 78. If the determination result from step S62 isaffirmative, the process of step S63 is executed. If the determinationresult from step S62 is negative, the process of step S65 to bedescribed later is executed.

In step S63, the CPU 31 determines whether or not the nearest point is aposition equal or prior to a priority point along the path. As in stepS62, the determination of step S63 can be made easily by referring tonumbers attached to the registered points. That is, the CPU 31 reads outthe nearest point data 78 and the priority point data 80 from the mainmemory 32, and determines whether the nearest point or the prioritypoint is subsequent to the other along the path by comparing the numberrepresented by the nearest point data 78 with the number represented bythe priority point data 80. If the determination result from step S63 isaffirmative, the process of step S64 is executed. If the determinationresult from step S63 is negative, the process of step S65 to bedescribed later is executed.

In step S64, the CPU 31 sets the nearest point as the return point. Thatis, the contents of the nearest point data 78 stored in the main memory32 are stored in the main memory 32 as the return point data 80. Afterstep S64, the CPU 31 exits the return point determination process.

In step S65, the CPU 31 sets the original point as the return point.That is, the contents of the original point data 77 stored in the mainmemory 32 are stored in the main memory 32 as the return point data 80.After step S65, the CPU 31 exits the return point determination process.

Referring back to FIG. 21, if the determination result from step S41described above is affirmative, the process through steps S53 to S55 isexecuted. The process through steps S53 to S55 is a process of returningthe second object 52, having finished a mid-path action, to a positionalong the path. The details of this will now be described.

In step S53, the CPU 31 moves the second object 52 toward the returnpoint. Specifically, the CPU 31 first reads out the return point data 80and the registered point data 76 from the main memory 32, and specifiesthe position of the return point in the game space. Then, the CPU 31reads out the second object data 82 from the main memory 32, and updatesthe position of the second object 52 represented by the second objectdata 82 to a position obtained by advancing the current position by apredetermined distance toward the position of the return point. Then,data representing the updated position of the second object 52 is storedin the main memory 32 as the new second object data 82. The secondobject 52 can be moved toward the return point at a predetermined speedby iterating the updating process described above over a plurality offrames (by iterating the process loop through steps S2 to S9 a pluralityof times). The process of step S54 is executed, following the process ofstep S53

In step S54, the CPU 31 determines whether or not the second object 52has reached the return point. That is, the CPU 31 reads out the secondobject data 82 from the main memory 32, and determines whether or notthe position of the second object 52 represented by the second objectdata 82 coincides with the position of the return point specified instep S53. The determination process of step S54 is a process fordetermining whether or not the second object 52 has returned to aposition along the path. If the determination result from step S54 isaffirmative, the process of step S55 is executed. If the determinationresult from step S54 is negative, the CPU 31 exits the move-along-pathprocess.

In step S55, the CPU 31 deletes the return point. Specifically, the CPU31 deletes the return point data 80 from the main memory 32. Because ofthe process of step S55, the determination result from step S41 will benegative in the move-along-path process to be executed next. At thispoint, the action flag has been reset to be OFF (step S49), andtherefore the determination result from step S42 will be negative.Therefore, in the move-along-path process to be executed next, theprocess of moving the second object 52 along the path (S43 to S46) isexecuted. After step S55, the CPU 31 exits the move-along-path process.

As illustrated in the move-along-path process above, in the presentembodiment, if a target object is located near the second object 52while the second object 52 is moving along the path (YES in step S44),the action flag is turned ON, and therefore the second object 52performs a mid-path action based on the target object (step S47 via YESin step S42). Then, when the second object 52 finishes the mid-pathaction (YES in step S48), the action flag is turned OFF, and the returnpoint is determined (step S52). Thus, the second object 52 moves to thereturn point, i.e., returns to a position along the path (step S53 viaYES in step S41). Moreover, when the second object 52 returns to aposition along the path (YES in step S54), the return point is deletedand the action flag is turned OFF, and thus the second object 52 resumesmoving along the path (step S43 via NO in steps S41 and S42). Asdescribed above, according to the present embodiment, the second object52 can resume moving along the path 56 even if the second object 52performs a mid-path action away from the path 56.

In the return point determination process described above, the nearestpoint is determined to be the return point (step S64) if the nearestpoint is equal or subsequent to the original point (YES in step S62) andif the nearest point is equal or prior to the priority point (YES instep S63), i.e., if the nearest point is between the original point andthe priority point. The original point is determined to be the returnpoint (step S65) if the nearest point is prior to the original point (NOin step S62) or if the nearest point is subsequent to the priority point(NO in step S63), i.e., if the nearest point is not between the originalpoint and the priority point. Therefore, in the present embodiment, thesecond object 52, having finished a mid-path action, will not return toa position prior to the original point or to a position subsequent tothe priority point. Moreover, the second object 52, having finished amid-path action, returns to a position that can be reached from thecurrent position within the shortest amount of time, provided that theposition is equal or subsequent to the original point and equal or priorto the priority point.

Note that in the return point determination process described above, theoriginal point is determined to be the return point if the nearest pointis not present between the original point and the priority point. Inother embodiments, in such a case, the CPU 31 may set, as the returnpoint, one of the registered points between the original point and thepriority point that can be reached within the shortest amount of timefrom the position of the second object 52 at the finish of the mid-pathaction. That is, in the return point determination process, the CPU 31may set, as the return point, one of the registered points equal orsubsequent to the original point and equal or prior to a predetermined“end point” that can be reached within the shortest amount of time fromthe position at the finish of the mid-path action. Herein, the “endpoint” is the earliest one of priority points if a priority point orpriority points are set, and is the latest registered point along thepath if no priority point is set.

Note that in the move-along-path process described above, the returnpoint is determined after a single mid-path action is finished. In otherembodiments, if one mid-path action includes a plurality of sub-actions,the CPU 31 may determine the return point each time a sub-action isfinished. Note that a case where one mid-path action includes aplurality of sub-actions is, for example, a case where the second object52 performs an action of defeating a plurality of enemy objects as amid-path action. In such a case, the CPU 31 may determine the returnpoint each time one enemy object is defeated. Then, if the limit amountof time described above elapses before all enemy objects are defeated,the second object 52 may be moved to the latest return point determined.

Referring back to FIG. 20, the CPU 31 determines whether or not thesecond object 52 has moved up to the end of the path in step S33. Thatis, the CPU 31 reads out the second object data 82 and the registeredpath data 75 from the main memory 32, and determines whether or not theposition of the second object 52 represented by the second object data82 coincides with the position of the end of the path represented by theregistered path data 75. If the determination result from step S33 isaffirmative, the process of step S34 is executed. If the determinationresult from step S33 is negative, the process of step S37 to bedescribed later is executed.

In step S34, the CPU 31 deletes the path registered in step S24described above. The process of deleting a registered path is similar tothe process of step S18 described above. The CPU 31 turns OFF the pathdisplay flag. That is, the CPU 31 updates the contents of the pathdisplay flag data 84 stored in the main memory 32 so that the flag isOFF. Therefore, when the second object 52 has moved up to the end of thepath, the path is deleted by the process of step S34 and is no longerdisplayed. The process of step S37 to be described later is executed,following step S34.

In step S35, the CPU 31 reads out, and refers to, the follow flag data85 from the main memory 32, so as to determine whether or not the followflag is set to be ON. The determination process of step S35 is a processfor determining whether or not an instruction for the second object 52to follow the first object 51 has been given by the player. If thedetermination result from step S35 is affirmative, the process of stepS36 is executed. If the determination result from step S35 is negative,the process of step S37 to be described later is executed.

In step S36, the CPU 31 moves the second object 52 so as to follow thefirst object 51. Specifically, the CPU 31 reads out the first objectdata 81 and the second object data 82 from the main memory 32, andupdates the position of the second object 52 to a position obtained byshifting the current position by a predetermined distance toward theposition of the first object 51. Data representing the updated positionof the second object 52 is stored in the main memory 32 as the newsecond object data 82. Note that in the present embodiment, in order toavoid an overlap between the position of the first object 51 and that ofthe second object 52, the CPU 31 does not update the position of thesecond object 52 when the position of the first object 51 is within apredetermined distance from the second object 52. The second object 52can be moved so as to follow the first object 51 by iterating theupdating process described above over a plurality of frames (byiterating the process loop through steps S2 to S9 a plurality of times).That is, when there is an instruction to follow the first object 51, thesecond object 52 first moves to the position of the first object 51(including a position near the first object 51). Moreover, if the firstobject 51 is moved by the first object control process (step S6), thesecond object 52 moves so as to follow the first object 51. The processof step S37 is executed, following step S36.

As described above, in the present embodiment, if the player makes atouch input on the follow icon 55 (YES in step S12 of FIG. 18), thefollow flag is set to be ON (step S13 of FIG. 18), and as a result, theprocess of step S36 is executed. That is, in the present embodiment, theplayer can move the second object 52 so as to follow the first object 51by touching the follow icon 55.

In the second object control process, the CPU 31 first executes thedetermination process of step S31, and later executes the determinationprocess of step S35. Therefore, if the player gives an instruction forthe second object 52 to follow the first object 51, and if the secondobject 52 is moving along the path, the process of step S32 describedabove is executed. That is, if such an instruction is given while thesecond object 52 is moving along the path, the second object 52 moves tothe end of the path, and then follows the first object 51. Note that inother embodiments, if such an instruction is given while the secondobject 52 is moving along the path, the CPU 31 may move the secondobject 52 so as to follow the first object 51 while discontinuing themovement along the path.

In step S37, the CPU 31 sets the path mark 53 based on the position ofthe second object 52. In the present embodiment, the CPU 31 places theobject of the path mark 53 at the position of the second object 52 inthe game space. Specifically, the CPU 31 reads out the second objectdata 82 from the main memory 32, and updates the position of the objectof the path mark 53 to a position determined based on the position ofthe second object 52. Data representing the updated position of the pathmark 53 is stored in the main memory 32 as the new path mark data 83.The path mark 53 is displayed at the position of the second object 52 asthe path mark data 83 is updated as described above. Note that in otherembodiments, while a path for moving the second object 52 therealong isbeing inputted, the CPU 31 may set the path mark 53 at the positionwhere the input is being made.

Note that the above phrase “the position determined based on theposition of the second object 52” is, for example, the position of thefeet of the second object 52 (see FIG. 3, etc.). Note however that theobject of the path mark 53 does not need to be placed fixedly withrespect to the second object 52, but the position at which the object ofthe path mark 53 is placed may vary depending on the condition, or thelike, of the position (terrain) where the second object 52 is located.For example, although the object of the path mark 53 is placed at thefeet of the second object 52 in FIG. 3 since the second object 52 isplaced on the ground, the object of the path mark 53 may be placed atthe position of the upper body of the second object 52 in a case wherethe lower body of the second object 52 is not displayed as it issubmerged in water, for example. Although the CPU 31 places an object ina three-dimensional game space in order to display the path mark 53 inthe present embodiment, an image representing the path mark 53 maysimply be displayed while being superimposed on the game space imagewithout placing the object in the game space, in other embodiments.After step S37, the CPU 31 exits the second object control process.

As illustrated in the process through steps S3 to S7 above, in thepresent embodiment, if the touch input starting position is locatedwithin the path mark 53, the controlled object flag is ON (step S17),and as a result, the CPU 31 controls the action of the first object 51based on the touch input (step S7), while skipping the process ofcontrolling the action of the first object 51 (step S6). If the touchinput starting position is located outside the path mark 53, thecontrolled object flag is OFF (step S19), and as a result, the CPU 31controls the action of the first object 51 based on the touch input(step S6). As described above, in the present embodiment, the CPU 31determines whether the object to be controlled by the touch input is thefirst object 51 or the second object 52, based on whether the touchinput starting position is outside or inside the path mark 53. In thisway, the player does not need to perform an operation only for switchingcontrolled objects from one to another, and therefore the player cancontrol two objects easily. Note that in other embodiments, the CPU 31may switch the controlled objects from one to another in response to apredetermined switching operation (e.g., an operation of pressing apredetermined operation button).

Note that in the second object control process of step S7 describedabove, if a path is registered, the second object 52 moves along thepath (step S31, S32). In the present embodiment, a path is registered atthe finish of a touch input by the player (steps S22 and S24).Therefore, in the present embodiment, the movement of the second object52 is started at the finish (completion) of a touch input. In the firstobject control process of step S6 described above, the action of thefirst object 51 is controlled in response to any touch input being made.That is, the first object 51 performs an action each time a touch inputis made, whereas the second object 52 performs an action (or moves) eachtime a path input is completed. Since the second object 52 performs anaction (or moves) upon completion of an input, the first object 51 canbe controlled to perform an action while the second object 52 is movingin the present embodiment. In this way, two objects will be performingactions at the same time, and thus the game apparatus 1 can make theplayer feel as if the player were controlling two objects at the sametime. Note that in other embodiments, the CPU 31 may start the movementof the second object 52 before the finish of a touch input. For example,the movement of the second object 52 may be started in response to atouch input starting from a position within the path mark 53, or afterthe passage of a predetermined amount of time since the start of thetouch input. The CPU 31 may control the first object 51 to perform anaction each time an input of a path on the input device is completed (ina case where the first object 51 is controlled to perform an actionalong a path).

In the game process of the present embodiment, when a new input is madeon the path mark 53 (YES in step S16 of FIG. 18), the existingregistered path is deleted (step S18 of FIG. 18). As shown in the secondobject control process described above, if the registered path isdeleted (NO in step S31), the process of moving the second object 52along the path (step S32) is not executed, and the second object 52stops moving along the path. Moreover, if a new path is inputted andregistered through the new input (YES in step S32), the second object 52starts moving along the new path (step S32). Therefore, in the presentembodiment, if the player newly inputs a different path while the secondobject 52 is moving along a path, the second object 52 moves along thenew path. That is, in the present embodiment, the player can change thepath while the second object 52 is moving along the path. Therefore, inthe present embodiment, if the player inadvertently inputs an unintendedpath, the player can readily correct the path.

Referring back to FIG. 17, in step S8, following step S7, the CPU 31executes a display control process. The display control process is aprocess of displaying a game image on the lower LCD 12 and the upper LCD22. Referring to FIG. 23, the details of the display control processwill now be described.

FIG. 23 is a flow chart illustrating the flow of the display controlprocess (step S8) shown in FIG. 17. First, in step S71 of the displaycontrol process, the CPU 31 determines whether or not the controlledobject flag is set to be ON. The determination process of step S71 isthe same as the determination process of step S22 described above. Ifthe determination result from step S71 is affirmative, the processthrough steps S72 and S73 is executed. If the determination result fromstep S71 is negative, the process through steps S74 and S75 to bedescribed later is executed.

In step S72, the CPU 31 sets the display area of the game space image sothat the second object 52 is included therein. The display area of thegame space image refers to an area of the game space that should bedisplayed on the lower LCD 12 as the game space image. Specifically, theCPU 31 reads out the second object data 82 from the main memory 32, andsets a display area of a predetermined area based on the position of thesecond object 52. Typically, the display area is set so that theposition of the second object 52 is generally at the center of thedisplay area. The process of step S73 is executed, following step S72.

In step S73, the CPU 31 produces a game space image representing thegame space in the display area set in step S72. That is, the CPU 31produces an image of the game space in the display area as viewed from apredetermined viewing position. Since the second object 52 and theobject of the path mark 53 are placed in the game space in the displayarea, the game space image at least includes the second object 52 andthe path mark 53. Note that if the first object 51 is present around thesecond object 52, the first object 51 is also included in the game spaceimage. The produced game space image is rendered in the first VRAM 47.Moreover, the CPU 31 renders the image of the switch icon 54,superimposed on the game space image rendered in the first VRAM 47. Theprocess of step S76 to be described later is executed, following stepS73.

In step S74, the CPU 31 sets the display area of the game space image sothat the first object 51 is included. Specifically, the CPU 31 reads outthe first object data 81 from the main memory 32, and sets a displayarea of a predetermined area based on the position of the first object51. Also in step S74, as in step S72 described above, the display areais typically set so that the position of the first object 51 isgenerally at the center of the display area. The process of step S75 isexecuted, following step S74.

In step S75, the CPU 31 produces a game space image representing thegame space in the display area set in step S74. The process of producinga game space image in step S75 is similar to the process in step S73,except that the position of the display area is different. The gamespace image produced in step S75 at least includes the first object 51.Note that if the second object 52 is present around the first object 51,the second object 52 and the path mark 53 are also included in the gamespace image. As in step S73, the produced game space image is renderedin the first VRAM 47. Moreover, in step S75, the CPU 31 renders theimages of the switch icon 54 and the follow icon 55, superimposed on thegame space image rendered in the first VRAM 47. The process of step S76is executed, following step S75.

As in steps S72 to S75 described above, in the present embodiment, thedisplay area is set (step S72) so that the second object 52 is includedin the game space image when the controlled object flag is ON (YES instep S71), whereas the display area is set (step S74) so that the secondobject 52 is included in the game space image when the controlled objectflag is OFF (YES in step S71). The controlled object flag is toggledbetween ON and OFF when a touch input is made on the switch icon 54(step S15 of FIG. 18). Therefore, by making a touch input on the switchicon 54, the player can easily switch between a mode where at least thefirst object 51 is displayed and a mode where at least the second object52 is displayed.

As in steps S73 and S75 described above, in the present embodiment, theCPU 31 displays the path mark 53, superimposed on the second object 52.As described above, the object to be controlled by the touch inputvaries depending on whether the touch input starting position is outsideor inside a predetermined designated area (the area of the path mark53). That is, the path mark 53 is displayed so as to present to theplayer, in an easy-to-understand manner, a designated area based onwhich either one of the two objects is controlled by the touch input.

As in steps S73 and S75 described above, in the present embodiment, theCPU 31 displays the follow icon 55 only when the controlled object flagis OFF (NO in step S71). The controlled object flag is ON when a touchinput is made starting from a position within the path mark 53 (step S17of FIG. 18), and is OFF when a touch input is made starting from aposition outside the path mark 53 (step S19 of FIG. 18). That is, in thepresent embodiment, the follow icon 55 is not displayed during a periodin which a touch input is being made starting from a position within thepath mark 53, i.e., during a period in which a touch input for movingthe second object 52 therealong is being made. This is because it isassumed that during such a period, the player is controlling the secondobject 52 to move along a path, and thus does not need the follow icon55 (the player will not touch the follow icon 55).

In step S76, the CPU 31 produces a map image. Although the specificmethod for producing a map image may be any suitable method, in thepresent embodiment, a two-dimensional full-length map image representingthe entire game space is prepared in advance, and the CPU 31 produces amap image by selecting an area of the full-length map image to bedisplayed. The area to be displayed as the map image is preferablyselected so that both the first object 51 and the second object 52 areincluded. The map image produced as described above is rendered in thesecond VRAM 48. Moreover, the CPU 31 renders the mark 61 representingthe first object 51 and the mark 62 representing the second object 52,superimposed on the map image rendered in the second VRAM 48. Theprocess of step S77 is executed, following step S76.

In step S77, the CPU 31 reads out, and refers to, the path display flagdata 84 from the main memory 32, so as to determine whether or not thepath display flag is set to be ON. The determination process of step S77is a process of determining whether or not there exists a path thatshould be displayed on the screen (i.e., a path being inputted formoving the second object 52 therealong, or a registered path). If thedetermination result from step S77 is affirmative, the process of stepS78 is executed. If the determination result from step S77 is negative,the process of step S79 to be described later is executed, whileskipping the process of step S78.

In step S78, the CPU 31 adds an image of a path for moving the secondobject 52 therealong on each of the images displayed on the LCDs 12 and22. In the present embodiment, the game space image displayed on thelower LCD 12 is an image representing the three-dimensional game space,whereas the map image displayed on the upper LCD 22 is an imagerepresenting a two-dimensional plane. The game space image and the mapimage described above differ from each other in terms of the size of thearea in the game space represented. Therefore, the CPU 31 produces theimage of a path (first path image) displayed on the lower LCD 12, andthe image of a path (second path image) displayed on the upper LCD 22,superimposed on the map image.

The first path image and the second path image described above areproduced by using the registered path data 75 (or the input path data74). Specifically, the CPU 31 reads out the registered path data 75 fromthe main memory 32, and produces, as the first path image, an image of aline that connects together, in the order of input, the coordinates ofone or more touch positions represented by the registered path data 75.For the second path image, the CPU 31 calculates the position on theground (in the game space) for each of one or more touch positionsrepresented by the registered path data 75, and produces an image of aline that connects together the calculated positions. Then, it ispossible to obtain the second path image by shrinking the produced lineimage in accordance with the size of the map image. Note that in otherembodiments, the CPU 31 may produce the second path image by applying apredetermined deformation (e.g., a deformation in which an image islongitudinally elongated) on the first path image. Where the shape ofthe first path image is close to that of the second path image, e.g.,where the game space image is an image of the game space as viewedgenerally from straight above, the CPU 31 may produce the second pathimage by simply shrinking the first path image. Thus, the second pathimage can be produced through a simple process.

If the registered path data 75 is not stored in the main memory 32, thefirst path image and the second path image described above are producedby using the input path data 74. The method of producing path images inthis case is similar to the production method described above, exceptthat the input path data 74 is used instead of the registered path data75. Note that the CPU 31 may vary the color and/or the shape of the pathimage depending on whether the registered path data 75 or the input pathdata 74 is used. In this way, the player can clearly distinguish betweena path being inputted (a path represented by the input path data 74) anda path that has been inputted (a path represented by the registered pathdata 75).

The CPU 31 renders the first path image produced as described above,superimposed on the game space image rendered in the first VRAM 47. TheCPU 31 renders the second path image described above, superimposed onthe map image rendered in the second VRAM 48. The process of step S79 isexecuted, following step S78.

As in step S78 described above, in the present embodiment, the image ofan inputted path is displayed not only in the game space image displayedon the lower LCD 12, but also in the map image displayed on the upperLCD 22. Thus, the player can visually check inputted paths even on themap image, which represents a larger area than the game space image onwhich the player makes touch inputs, thereby further facilitating thepath inputting operation.

In other embodiments, when a path inputted by the player is displayed onthe screen, the CPU 31 may display an image representing the prioritypoint on the screen, in addition to the image of the path. The CPU 31may vary the line color, the line thickness and/or the line type (e.g.,dotted or solid), etc., between a portion of a whole path that has beenpassed by the second object 52 and a portion that has not been passed bythe second object 52.

In step S79, the CPU 31 displays the game space image and the map imageon the LCDs 12 and 22, respectively. That is, the CPU 31 displays thegame space image rendered in the first VRAM 47 on the lower LCD 12, andthe map image rendered in the second VRAM 48 on the upper LCD 22. Afterstep S79, the CPU 31 exits the display control process.

Referring back to FIG. 17, in step S9, following step S8, the CPU 31determines whether or not the game should be terminated. Thedetermination of step S9 is made based on, for example, whether or notthe game has been cleared, the game has been over, or the player hasgiven an instruction to quit the game. If the determination result fromstep S9 is negative, the process of step S2 is executed again. Theprocess loop through steps S2 to S9 is repeated until it is determinedin step S9 that the game should be terminated. If the determinationresult from step S9 is affirmative, the CPU 31 exits the game processshown in FIG. 17. The game process is as described above.

As described above, in the game process of the present embodiment, thegame apparatus 1 accepts an input of a path for moving the second object52 therealong, not on the map image but on the game space image. In thisway, the player can control an object looking at the game space imagewhether the player is controlling the first object 51 or the secondobject 52. Therefore, in the present embodiment, the player can easilyperform an operation of inputting a path, without having to switch thescreen from the map image to the game space image.

[Variations]

In the embodiment described above, the game apparatus 1 includes twoscreens (the lower LCD 12 and the upper LCD 22), and displays the gamespace image and the map image at the same time. In other embodiments,the game apparatus 1 does not have to display the map image. Even whenthe map image is displayed, the game apparatus 1 does not need todisplay the game space image and the map image at the same time, but mayselectively display one of the images on a single display screen. Notethat while the game space image represents a partial area of athree-dimensional game space in the embodiment described above, the gamespace image may represent a two-dimensional game space or may representthe whole of the game space. While the map image represents atwo-dimensional plane in the embodiment described above, the map imagemay be any suitable type of image that represents a larger area than thegame space image, and may represent a three-dimensional game space.

The embodiment described above has been directed to an example of thegame apparatus 1, which includes the touch panel 13 as an input device(pointing device) with which it is possible to specify a position on thescreen of the display device. In other embodiments, the input devicewith which it is possible to specify a position on the screen of thedisplay device may be a pointing device such as a mouse or a touch pad.The present invention can also be applicable to a system in which theorientation of an input device is detected by the use of a camera and/oran acceleration sensor, and the position on the display screen that isbeing pointed by the input device is calculated based on theorientation.

The embodiment described above has been directed to an example where thegame apparatus 1 controls the action of the first object 51 based on thetouch input on the touch panel 13. In other embodiments, the action ofthe first object 51 may be controlled not only by the touch input by theplayer, but also by an input made through an operation button and/or asound input made through a microphone 43, instead of, or in addition to,the touch input.

Note that in a game apparatus employing an input system through whichthe player can freely input a path on the screen, as in the embodimentdescribed above, a path may be inputted in an area where the secondobject 52 cannot be moved. For example, even if a path is inputted,extending across a wall displayed on the screen, the second object 52cannot move across the wall. In view of such cases, the game apparatus 1may perform the following process in the game process described above.That is, when the second object 52 can no longer be moved along a path,the game apparatus 1 may stop moving the second object 52 and erase thepath. Specifically, in step S43 described above, the CPU 31 determineswhether or not the second object 52 can move along the path, and if thesecond object 52 cannot be moved, the second object 52 is not moved.Moreover, the registered path data 75 and the registered point data 76stored in the main memory 32 are erased. In the return pointdetermination process of step S52 described above, if the nearest pointselected in step S61 is a position that the second object 52 cannotenter, the CPU 31 may determine the original point to be the returnpoint (irrespective of the determination results from steps S62 and563).

In the embodiment described above, the game apparatus 1 sets registeredpoints along a path inputted by the player (step S25) in order tosimplify the process of determining the return point. In otherembodiments, the game apparatus 1 may set no registered points, and maydetermine a position (return position) to which the second object 52 isreturned when a mid-path action is finished, from among all points ofthe path. Then, the original point, the nearest point and the prioritypoint described above are also determined from among all points of thepath, as with the return point. Specifically, the original point is thenthe position of the second object 52 at the start of the mid-pathaction. The nearest point is the position of a point, from among allpoints of the path, that can be reached within the shortest amount oftime from the position of the second object 52 at the finish of themid-path action. The priority point is a position at which the secondobject 52 performs an event action, from among all points along thepath.

The present invention is applicable to, for example, a game program or agame apparatus, aiming at, for example, allowing the player to easilyperform an operation in which an object is moved by using a path on thescreen.

While the invention has been described in detail, the foregoingdescription is in all aspects illustrative and not restrictive. It isunderstood that numerous other modifications and variations can bedevised without departing from the scope of the invention.

1. A game apparatus having an input device with which it is possible tospecify a position on a screen of a display device, the game apparatuscomprising: a display control unit for displaying a game image with afirst object and a second object, the game image representing a virtualgame space on the display device; a designated area setting unit forsetting a designated area in association with the second object in thegame image, the designated area being partially located on the secondobject in the game image; an input detection unit for detecting an inputmade on the game image by using the input device; and an inputdetermining unit for determining whether the detected input is either apointing input made on the game image at a position located outside thedesignated area, or a path input drawn on the game image to at leastpartially extend through the designated area, wherein if the detectedinput is the pointing input, controlling an action of the first objectin the game image based on the pointing input made on the game image byusing the input device, and if the detected input is the path input,controlling an action of the second object in the game image to movealong a path based on the path input drawn on the game image by usingthe input device.
 2. A non-transitory computer-readable storage mediumhaving stored therein a game program to be executed by a computer in agame apparatus including an input device with which it is possible tospecify a position on a screen of a display device, the program causingthe computer to execute functionality comprising: displaying a gameimage with a first object and a second object, the game imagerepresenting a virtual game space on the display device; setting adesignated area in association with the second object in the game image,the designated area being partially located on the second object in thegame image; detecting an input made on the game image by using the inputdevice; and determining whether the detected input is either a pointinginput made on the game image at a position located outside thedesignated area, or a path input drawn on the game image to at leastpartially extend through the designated area, wherein if the detectedinput is the pointing input, controlling an action of the first objectin the game image based on the pointing input made on the game image byusing the input device, and if the detected input is the path input,controlling an action of the second object in the game image to movealong a path based on the path input drawn on the game image by usingthe input device.
 3. The non-transitory computer readable storage mediumaccording to claim 1, wherein the game program causes the computer tofurther execute functionality comprising displaying the pathsuperimposed on the game image.
 4. The non-transitory computer readablestorage medium according to claim 3, wherein the game program causes thecomputer to further execute functionality comprising displaying an imagerepresenting the designated area superimposed on an image of the secondobject in the game image.
 5. The non-transitory computer readablestorage medium according to claim 3, wherein: the designated area ismoved together with the second object, based on the path input; and if anew path input starting from a position within the designated area ismade by using the input device while the second object is moving alongthe path, the second object is moved along a new path based on the newpath input.
 6. The non-transitory computer readable storage mediumaccording to claim 1, wherein the game program causes the computer tofurther execute functionality comprising moving the first object basedon the pointing input made on the game image by using the input device.7. The non-transitory computer readable storage medium according toclaim 1, wherein: the first object is controlled to perform the actioneach time the pointing input made on the game image by using the inputdevice is detected; and the second object is moved each time the pathinput is completed.
 8. The non-transitory computer readable storagemedium according to claim 1, wherein if a predetermined instruction isgiven by a player, the movement of the second object is controlled basedon a position of the first object.
 9. The non-transitory computerreadable storage medium according to claim 8, wherein if thepredetermined instruction is given by the player, the second object ismoved to the position of the first object, and then the second object ismoved so as to follow the first object.
 10. The non-transitory computerreadable storage medium according to claim 8, wherein: a predeterminedimage is displayed on the game image so that the predetermined image iserased at least while the path input starting from a position within thedesignated area is being made on the game image; and the movement of thesecond object is controlled by using the path input made by the inputdevice at a position of the predetermined image as the predeterminedinstruction.
 11. The non-transitory computer readable storage mediumaccording to claim 1, wherein, based on an instruction from a player,switching occurs between a state where a display area of a virtual gamespace is set so that the first object is included in the game image andanother state where the display area is set so that the second object isincluded in the game image.
 12. The non-transitory computer readablestorage medium according to claim 1, wherein one of, or simultaneouslyboth of, the game image and a wide-area image representing a larger areathan an area of a game space represented by the game image, is displayedon the display device.
 13. The non-transitory computer readable storagemedium according to claim 12, wherein the game program causes thecomputer to further execute functionality comprising displaying the pathsuperimposed on the wide-area image.
 14. A game system, comprising: aninput device configured to specify a position on a screen of a displaydevice; and a game apparatus having the display device and one or moreprocessors, the game apparatus comprising: a display control unit fordisplaying a game image with a first object and a second object, thegame image representing a virtual game space on the display device, adesignated area setting unit for setting a designated area inassociation with the second object in the game image, the designatedarea being partially located on the second object in the game image, aninput detection unit for detecting an input made on the game image byusing the input device, and an input determining unit for determiningwhether the detected input is either a pointing input made on the gameimage at a position located outside the designated area, or a path inputdrawn on the game image to at least partially extend through thedesignated area, wherein if the detected input is the pointing input,controlling an action of the first object in the game image based on thepointing input made on the game image by using the input device, and ifthe detected input is the path input, controlling an action of thesecond object in the game image to move along a path based on the pathinput drawn on the game image by using the input device.
 15. A methodimplemented in a computer in a game apparatus having one or moreprocessors and including an input device with which it is possible tospecify a position on a screen of a display device, the methodcomprising: displaying a game image with a first object and a secondobject, the game image representing a virtual game space on the displaydevice; setting a designated area in association with the second objectin the game image, the designated area being partially located on thesecond object in the game image; detecting an input made on the gameimage by using the input device; and determining whether the detectedinput is either a pointing input made on the game image at a positionlocated outside the designated area, or a path input drawn on the gameimage to at least partially extend through the designated area, whereinif the detected input is the pointing input, controlling an action ofthe first object in the game image based on the pointing input made onthe game image by using the input device, and if the detected input isthe path input, controlling an action of the second object in the gameimage to move along a path based on the path input drawn on the gameimage by using the input device.